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)


Detailed Description

Definition at line 97 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(), and SimParameters::send_SimParameters().

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 }

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

Definition at line 174 of file MStream.h.

References put().

00174                               {
00175       size_t length = strlen(data);
00176       put((int)length);
00177       return put(length, data);
00178     }

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

Definition at line 171 of file MStream.h.

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

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

Definition at line 168 of file MStream.h.

00168                                 { 
00169       return Put((char *)data,sizeof(Vector)); 
00170     }

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

Definition at line 165 of file MStream.h.

00165                                             { 
00166       return Put((char *)data,len*sizeof(double)); 
00167     }

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

Definition at line 162 of file MStream.h.

00162                                            { 
00163       return Put((char *)data,len*sizeof(float)); 
00164     }

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

Definition at line 159 of file MStream.h.

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

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

Definition at line 156 of file MStream.h.

00156                                           { 
00157       return Put((char *)data,len*sizeof(long)); 
00158     }

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

Definition at line 153 of file MStream.h.

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

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

Definition at line 150 of file MStream.h.

00150                                          { 
00151       return Put((char *)data,len*sizeof(int)); 
00152     }

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

Definition at line 147 of file MStream.h.

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

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

Definition at line 144 of file MStream.h.

00144                                            { 
00145       return Put((char *)data,len*sizeof(short)); 
00146     }

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

Definition at line 141 of file MStream.h.

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

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

Definition at line 138 of file MStream.h.

00138                                           { 
00139       return Put(data,len*sizeof(char)); 
00140     }

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

Definition at line 135 of file MStream.h.

00135                                { 
00136       return Put((char *)&data, sizeof(double)); 
00137     }

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

Definition at line 132 of file MStream.h.

00132                               { 
00133       return Put((char *)&data, sizeof(float)); 
00134     }

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

Definition at line 129 of file MStream.h.

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

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

Definition at line 126 of file MStream.h.

00126                              { 
00127       return Put((char *)&data, sizeof(long)); 
00128     }

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

Definition at line 123 of file MStream.h.

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

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

Definition at line 120 of file MStream.h.

00120                             { 
00121       return Put((char *)&data, sizeof(int)); 
00122     }

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

Definition at line 117 of file MStream.h.

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

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

Definition at line 114 of file MStream.h.

00114                               { 
00115       return Put((char *)&data, sizeof(short)); 
00116     }

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

Definition at line 111 of file MStream.h.

00111                                       { 
00112       return Put((char *)&data,sizeof(unsigned char)); 
00113     }

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

Definition at line 108 of file MStream.h.

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

00108                              { 
00109       return Put(&data,sizeof(char)); 
00110     }


The documentation for this class was generated from the following files:
Generated on Wed Nov 22 01:17:21 2017 for NAMD by  doxygen 1.4.7