Buffer for the communications layer of parallel simulation. More...
#include <ccommbuffer.h>
Public Member Functions | |
virtual | ~cCommBuffer () |
Buffer management | |
virtual bool | isBufferEmpty () const =0 |
virtual void | assertBufferEmpty ()=0 |
Pack basic types | |
virtual void | pack (char d)=0 |
virtual void | pack (unsigned char d)=0 |
virtual void | pack (bool d)=0 |
virtual void | pack (short d)=0 |
virtual void | pack (unsigned short d)=0 |
virtual void | pack (int d)=0 |
virtual void | pack (unsigned int d)=0 |
virtual void | pack (long d)=0 |
virtual void | pack (unsigned long d)=0 |
virtual void | pack (opp_long_long d)=0 |
virtual void | pack (opp_unsigned_long_long d)=0 |
virtual void | pack (float d)=0 |
virtual void | pack (double d)=0 |
virtual void | pack (long double d)=0 |
virtual void | pack (const char *d)=0 |
virtual void | pack (const opp_string &d)=0 |
virtual void | pack (SimTime d)=0 |
Pack arrays of basic types | |
virtual void | pack (const char *d, int size)=0 |
virtual void | pack (const unsigned char *d, int size)=0 |
virtual void | pack (const bool *d, int size)=0 |
virtual void | pack (const short *d, int size)=0 |
virtual void | pack (const unsigned short *d, int size)=0 |
virtual void | pack (const int *d, int size)=0 |
virtual void | pack (const unsigned int *d, int size)=0 |
virtual void | pack (const long *d, int size)=0 |
virtual void | pack (const unsigned long *d, int size)=0 |
virtual void | pack (const opp_long_long *d, int size)=0 |
virtual void | pack (const opp_unsigned_long_long *d, int size)=0 |
virtual void | pack (const float *d, int size)=0 |
virtual void | pack (const double *d, int size)=0 |
virtual void | pack (const long double *d, int size)=0 |
void | pack (char **d, int size) |
virtual void | pack (const char **d, int size)=0 |
virtual void | pack (const opp_string *d, int size)=0 |
virtual void | pack (const SimTime *d, int size)=0 |
Unpack basic types | |
virtual void | unpack (char &d)=0 |
virtual void | unpack (unsigned char &d)=0 |
virtual void | unpack (bool &d)=0 |
virtual void | unpack (short &d)=0 |
virtual void | unpack (unsigned short &d)=0 |
virtual void | unpack (int &d)=0 |
virtual void | unpack (unsigned int &d)=0 |
virtual void | unpack (long &d)=0 |
virtual void | unpack (unsigned long &d)=0 |
virtual void | unpack (opp_long_long &d)=0 |
virtual void | unpack (opp_unsigned_long_long &d)=0 |
virtual void | unpack (float &d)=0 |
virtual void | unpack (double &d)=0 |
virtual void | unpack (long double &d)=0 |
void | unpack (char *&d) |
virtual void | unpack (const char *&d)=0 |
virtual void | unpack (opp_string &d)=0 |
virtual void | unpack (SimTime &d)=0 |
Unpack arrays of basic types | |
virtual void | unpack (char *d, int size)=0 |
virtual void | unpack (unsigned char *d, int size)=0 |
virtual void | unpack (bool *d, int size)=0 |
virtual void | unpack (short *d, int size)=0 |
virtual void | unpack (unsigned short *d, int size)=0 |
virtual void | unpack (int *d, int size)=0 |
virtual void | unpack (unsigned int *d, int size)=0 |
virtual void | unpack (long *d, int size)=0 |
virtual void | unpack (unsigned long *d, int size)=0 |
virtual void | unpack (opp_long_long *d, int size)=0 |
virtual void | unpack (opp_unsigned_long_long *d, int size)=0 |
virtual void | unpack (float *d, int size)=0 |
virtual void | unpack (double *d, int size)=0 |
virtual void | unpack (long double *d, int size)=0 |
void | unpack (char **d, int size) |
virtual void | unpack (const char **d, int size)=0 |
virtual void | unpack (opp_string *d, int size)=0 |
virtual void | unpack (SimTime *d, int size)=0 |
Utility functions | |
bool | packFlag (bool flag) |
bool | checkFlag () |
virtual void | packObject (cObject *obj) |
virtual cObject * | unpackObject () |
Buffer for the communications layer of parallel simulation.
This is an abstract class which has different implementations for specific communication mechanisms. For example, the MPI implementation, cMPICommBuffer encapsulates MPI_Pack() and MPI_Unpack().
virtual void cCommBuffer::assertBufferEmpty | ( | ) | [pure virtual] |
Utility function.
To be called after unpacking a communication buffer, it checks whether the buffer is empty. If it is not (i.e. an underflow or overflow occurred), an exception is thrown.
virtual bool cCommBuffer::isBufferEmpty | ( | ) | const [pure virtual] |
Returns true if all data in buffer was used up during unpacking.
Returns false if there was underflow (too much data unpacked) or still there are unpacked data in the buffer.