Revision 1168 branches/threaded2/src/linad99/thread_stuff.cpp

thread_stuff.cpp (revision 1168)
1064 1064
  readbuffer(&x,sizeof(double),sno);
1065 1065
  return x;
1066 1066
}
1067

  
1067 1068
double adpthread_manager::get_double(int sno)
1068 1069
{
1069 1070
  verify_id_string_from_master("TY",sno);
......
1775 1776
  writebuffer(&mmax,sizeof(int),sno);
1776 1777
  writebuffer(&(x(mmin)),sz*sizeof(int),sno);
1777 1778
}
1779

  
1780
void adpthread_manager::send_adstring(const adstring & _x,int sno)
1781
{
1782
  ADUNCONST(adstring,x)
1783
  const int sz = x.size();
1784
  send_id_string_to_slave("ST",sno);
1785
  writebuffer(&sz,sizeof(int),sno);
1786
  writebuffer((char*)x,sz,sno);
1787
}
1788

  
1789
adstring adpthread_manager::get_adstring(int sno)
1790
{
1791
  verify_id_string_from_master("ST",sno);
1792
  int sz;
1793
  readbuffer(&sz,sizeof(int),sno);
1794
  char * s = new char(sz); ;
1795
  readbuffer(s,sz,sno);
1796
  s[sz] = '\0';
1797
  adstring x(s);
1798
  delete [] s;  
1799
  return adstring(x);
1800
}

Also available in: Unified diff