MOStream Class Reference

#include <MStream.h>

List of all members.

Public Member Functions

 MOStream (Communicate *c, int pe, int tag, size_t bufSize)
 ~MOStream ()
void end (void)
MOStreamput (char data)
MOStreamput (unsigned char data)
MOStreamput (short data)
MOStreamput (unsigned short data)
MOStreamput (int data)
MOStreamput (unsigned int data)
MOStreamput (long data)
MOStreamput (unsigned long data)
MOStreamput (float data)
MOStreamput (double data)
MOStreamput (size_t len, char *data)
MOStreamput (size_t len, unsigned char *data)
MOStreamput (size_t len, short *data)
MOStreamput (size_t len, unsigned short *data)
MOStreamput (size_t len, int *data)
MOStreamput (size_t len, unsigned int *data)
MOStreamput (size_t len, long *data)
MOStreamput (size_t len, unsigned long *data)
MOStreamput (size_t len, float *data)
MOStreamput (size_t len, double *data)
MOStreamput (Vector *data)
MOStreamput (size_t len, Vector *data)
MOStreamput (char *data)
template<class T>
MOStreamput (size_t len, T *data)


Detailed Description

Definition at line 101 of file MStream.h.


Constructor & Destructor Documentation

MOStream::MOStream ( Communicate c,
int  pe,
int  tag,
size_t  bufSize 
)

Definition at line 44 of file MStream.C.

References StreamMessage::checksum, StreamMessage::index, StreamMessage::len, StreamMessage::next, StreamMessage::PE, and StreamMessage::tag.

00045 {
00046   cobj = c;
00047   PE = p;
00048   tag = t;
00049   bufLen = size;
00050   msgBuf = (StreamMessage *)CmiAlloc(sizeof(StreamMessage)+size);
00051   msgBuf->PE = CmiMyPe();
00052   msgBuf->tag = tag;
00053   msgBuf->len = 0;
00054   msgBuf->index = 0;
00055   msgBuf->next = (StreamMessage *)0;
00056   msgBuf->checksum = 0;
00057 }

MOStream::~MOStream (  ) 

Definition at line 59 of file MStream.C.

00060 {
00061   if(msgBuf != 0)
00062     CmiFree(msgBuf);
00063 }


Member Function Documentation

void MOStream::end ( void   ) 

Definition at line 176 of file MStream.C.

References StreamMessage::checksum, StreamMessage::data, DebugM, StreamMessage::index, StreamMessage::len, and Communicate::sendMessage().

Referenced by WorkDistrib::recvComputeMapChanges(), Node::reloadGridforceGrid(), Molecule::send_GoMolecule(), Parameters::send_Parameters(), SimParameters::send_SimParameters(), and WorkDistrib::sendComputeMap().

00177 {
00178   if ( msgBuf->len == 0 ) return; // don't send empty message
00179   if ( msgBuf->index && ! ((msgBuf->index) % 100) ) {
00180     DebugM(3,"Sending message " << msgBuf->index << ".\n");
00181   }
00182   msgBuf->checksum = 0;
00183   for ( size_t i=0; i < msgBuf->len; i++ ) {
00184     msgBuf->checksum += (unsigned char) msgBuf->data[i];
00185   }
00186   cobj->sendMessage(PE,(void*)msgBuf,msgBuf->len+sizeof(StreamMessage)-1);
00187   msgBuf->len = 0;
00188   msgBuf->index += 1;
00189 }

template<class T>
MOStream* MOStream::put ( size_t  len,
T *  data 
) [inline]

Definition at line 184 of file MStream.h.

00184                                        { 
00185       return Put((char *)data,len*sizeof(T)); 
00186     }

MOStream* MOStream::put ( char *  data  )  [inline]

Definition at line 178 of file MStream.h.

References put().

00178                               {
00179       size_t length = strlen(data);
00180       put((int)length);
00181       return put(length, data);
00182     }

MOStream* MOStream::put ( size_t  len,
Vector data 
) [inline]

Definition at line 175 of file MStream.h.

00175                                             { 
00176       return Put((char *)data,len*sizeof(Vector)); 
00177     }

MOStream* MOStream::put ( Vector data  )  [inline]

Definition at line 172 of file MStream.h.

00172                                 { 
00173       return Put((char *)data,sizeof(Vector)); 
00174     }

MOStream* MOStream::put ( size_t  len,
double *  data 
) [inline]

Definition at line 169 of file MStream.h.

00169                                             { 
00170       return Put((char *)data,len*sizeof(double)); 
00171     }

MOStream* MOStream::put ( size_t  len,
float *  data 
) [inline]

Definition at line 166 of file MStream.h.

00166                                            { 
00167       return Put((char *)data,len*sizeof(float)); 
00168     }

MOStream* MOStream::put ( size_t  len,
unsigned long *  data 
) [inline]

Definition at line 163 of file MStream.h.

00163                                                    { 
00164       return Put((char *)data,len*sizeof(unsigned long)); 
00165     }

MOStream* MOStream::put ( size_t  len,
long *  data 
) [inline]

Definition at line 160 of file MStream.h.

00160                                           { 
00161       return Put((char *)data,len*sizeof(long)); 
00162     }

MOStream* MOStream::put ( size_t  len,
unsigned int *  data 
) [inline]

Definition at line 157 of file MStream.h.

00157                                                   { 
00158       return Put((char *)data,len*sizeof(unsigned int)); 
00159     }

MOStream* MOStream::put ( size_t  len,
int *  data 
) [inline]

Definition at line 154 of file MStream.h.

00154                                          { 
00155       return Put((char *)data,len*sizeof(int)); 
00156     }

MOStream* MOStream::put ( size_t  len,
unsigned short *  data 
) [inline]

Definition at line 151 of file MStream.h.

00151                                                     { 
00152       return Put((char *)data,len*sizeof(unsigned short)); 
00153     }

MOStream* MOStream::put ( size_t  len,
short *  data 
) [inline]

Definition at line 148 of file MStream.h.

00148                                            { 
00149       return Put((char *)data,len*sizeof(short)); 
00150     }

MOStream* MOStream::put ( size_t  len,
unsigned char *  data 
) [inline]

Definition at line 145 of file MStream.h.

00145                                                    { 
00146       return Put((char *)data,len*sizeof(unsigned char)); 
00147     }

MOStream* MOStream::put ( size_t  len,
char *  data 
) [inline]

Definition at line 142 of file MStream.h.

00142                                           { 
00143       return Put(data,len*sizeof(char)); 
00144     }

MOStream* MOStream::put ( double  data  )  [inline]

Definition at line 139 of file MStream.h.

00139                                { 
00140       return Put((char *)&data, sizeof(double)); 
00141     }

MOStream* MOStream::put ( float  data  )  [inline]

Definition at line 136 of file MStream.h.

00136                               { 
00137       return Put((char *)&data, sizeof(float)); 
00138     }

MOStream* MOStream::put ( unsigned long  data  )  [inline]

Definition at line 133 of file MStream.h.

00133                                       { 
00134       return Put((char *)&data, sizeof(unsigned long)); 
00135     }

MOStream* MOStream::put ( long  data  )  [inline]

Definition at line 130 of file MStream.h.

00130                              { 
00131       return Put((char *)&data, sizeof(long)); 
00132     }

MOStream* MOStream::put ( unsigned int  data  )  [inline]

Definition at line 127 of file MStream.h.

00127                                      { 
00128       return Put((char *)&data, sizeof(unsigned int)); 
00129     }

MOStream* MOStream::put ( int  data  )  [inline]

Definition at line 124 of file MStream.h.

00124                             { 
00125       return Put((char *)&data, sizeof(int)); 
00126     }

MOStream* MOStream::put ( unsigned short  data  )  [inline]

Definition at line 121 of file MStream.h.

00121                                        { 
00122       return Put((char *)&data, sizeof(unsigned short)); 
00123     }

MOStream* MOStream::put ( short  data  )  [inline]

Definition at line 118 of file MStream.h.

00118                               { 
00119       return Put((char *)&data, sizeof(short)); 
00120     }

MOStream* MOStream::put ( unsigned char  data  )  [inline]

Definition at line 115 of file MStream.h.

00115                                       { 
00116       return Put((char *)&data,sizeof(unsigned char)); 
00117     }

MOStream* MOStream::put ( char  data  )  [inline]

Definition at line 112 of file MStream.h.

Referenced by GridforceLiteGrid::pack(), GridforceFullSubGrid::pack(), GridforceFullMainGrid::pack(), GridforceFullBaseGrid::pack(), ComputeMap::pack(), MGridforceParamsList::pack_data(), GridforceGrid::pack_grid(), put(), WorkDistrib::recvComputeMapChanges(), Molecule::send_GoMolecule(), Molecule::send_Molecule(), Parameters::send_Parameters(), and SimParameters::send_SimParameters().

00112                              { 
00113       return Put(&data,sizeof(char)); 
00114     }


The documentation for this class was generated from the following files:
Generated on Sat Sep 22 01:17:20 2018 for NAMD by  doxygen 1.4.7