OMNeT++ Simulation Library  6.0.3
cCommBuffer Class Referenceabstract

#include <ccommbuffer.h>

Description

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().

See also
cObject::parsimPack(), cObject::parsimUnpack()
Inheritance diagram for cCommBuffer:
cObject

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 (long long d)=0
 
virtual void pack (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 long long *d, int size)=0
 
virtual void pack (const 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 (long long &d)=0
 
virtual void unpack (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 (long long *d, int size)=0
 
virtual void unpack (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 cObjectunpackObject ()
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)=default
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
virtual const char * getName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
virtual std::string getClassAndFullName () const
 
virtual std::string getClassAndFullPath () const
 
const cObjectgetThisPtr () const
 
virtual std::string str () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual cObjectdup () const
 
virtual void parsimPack (cCommBuffer *buffer) const
 
virtual void parsimUnpack (cCommBuffer *buffer)
 
virtual cObjectgetOwner () const
 
virtual bool isOwnedObject () const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Additional Inherited Members

- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Constructor & Destructor Documentation

◆ ~cCommBuffer()

virtual ~cCommBuffer ( )
inlinevirtual

Virtual destructor

Member Function Documentation

◆ isBufferEmpty()

virtual bool 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.

◆ assertBufferEmpty()

virtual void 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.

◆ pack() [1/35]

virtual void pack ( char  d)
pure virtual

Packs a character.

◆ pack() [2/35]

virtual void pack ( unsigned char  d)
pure virtual

Packs an unsigned character.

◆ pack() [3/35]

virtual void pack ( bool  d)
pure virtual

Packs a bool.

◆ pack() [4/35]

virtual void pack ( short  d)
pure virtual

Packs a short int.

◆ pack() [5/35]

virtual void pack ( unsigned short  d)
pure virtual

Packs an unsigned short int.

◆ pack() [6/35]

virtual void pack ( int  d)
pure virtual

Packs an int.

◆ pack() [7/35]

virtual void pack ( unsigned int  d)
pure virtual

Packs an unsigned int.

◆ pack() [8/35]

virtual void pack ( long  d)
pure virtual

Packs a long int.

◆ pack() [9/35]

virtual void pack ( unsigned long  d)
pure virtual

Packs an unsigned long int.

◆ pack() [10/35]

virtual void pack ( long long  d)
pure virtual

Packs a long long.

◆ pack() [11/35]

virtual void pack ( unsigned long long  d)
pure virtual

Packs an unsigned long long.

◆ pack() [12/35]

virtual void pack ( float  d)
pure virtual

Packs a float.

◆ pack() [13/35]

virtual void pack ( double  d)
pure virtual

Packs a double.

◆ pack() [14/35]

virtual void pack ( long double  d)
pure virtual

Packs a long double.

◆ pack() [15/35]

virtual void pack ( const char *  d)
pure virtual

Packs a string.

◆ pack() [16/35]

virtual void pack ( const opp_string d)
pure virtual

Packs a string.

◆ pack() [17/35]

virtual void pack ( SimTime  d)
pure virtual

Packs a SimTime.

◆ pack() [18/35]

virtual void pack ( const char *  d,
int  size 
)
pure virtual

Packs an array of chars.

◆ pack() [19/35]

virtual void pack ( const unsigned char *  d,
int  size 
)
pure virtual

Packs an array of unsigned chars.

◆ pack() [20/35]

virtual void pack ( const bool *  d,
int  size 
)
pure virtual

Packs an array of bools.

◆ pack() [21/35]

virtual void pack ( const short *  d,
int  size 
)
pure virtual

Packs an array of shorts.

◆ pack() [22/35]

virtual void pack ( const unsigned short *  d,
int  size 
)
pure virtual

Packs an array of unsigned shorts.

◆ pack() [23/35]

virtual void pack ( const int *  d,
int  size 
)
pure virtual

Packs an array of ints.

◆ pack() [24/35]

virtual void pack ( const unsigned int *  d,
int  size 
)
pure virtual

Packs an array of unsigned ints.

◆ pack() [25/35]

virtual void pack ( const long *  d,
int  size 
)
pure virtual

Packs an array of longs.

◆ pack() [26/35]

virtual void pack ( const unsigned long *  d,
int  size 
)
pure virtual

Packs an array of unsigned longs.

◆ pack() [27/35]

virtual void pack ( const long long *  d,
int  size 
)
pure virtual

Packs an array of long long's.

◆ pack() [28/35]

virtual void pack ( const unsigned long long *  d,
int  size 
)
pure virtual

Packs an array of unsigned long long's.

◆ pack() [29/35]

virtual void pack ( const float *  d,
int  size 
)
pure virtual

Packs an array of floats.

◆ pack() [30/35]

virtual void pack ( const double *  d,
int  size 
)
pure virtual

Packs an array of doubles.

◆ pack() [31/35]

virtual void pack ( const long double *  d,
int  size 
)
pure virtual

Packs an array of long doubles.

◆ pack() [32/35]

void pack ( char **  d,
int  size 
)
inline

Packs an array of strings.

References cCommBuffer::pack().

Referenced by cCommBuffer::pack().

◆ pack() [33/35]

virtual void pack ( const char **  d,
int  size 
)
pure virtual

Packs an array of strings.

◆ pack() [34/35]

virtual void pack ( const opp_string d,
int  size 
)
pure virtual

Packs an array of opp_strings.

◆ pack() [35/35]

virtual void pack ( const SimTime d,
int  size 
)
pure virtual

Packs an array of SimTimes.

◆ unpack() [1/36]

virtual void unpack ( char &  d)
pure virtual

Unpacks a char.

◆ unpack() [2/36]

virtual void unpack ( unsigned char &  d)
pure virtual

Unpacks an unsigned char.

◆ unpack() [3/36]

virtual void unpack ( bool &  d)
pure virtual

Unpacks a bool.

◆ unpack() [4/36]

virtual void unpack ( short &  d)
pure virtual

Unpacks a short.

◆ unpack() [5/36]

virtual void unpack ( unsigned short &  d)
pure virtual

Unpacks an unsigned short.

◆ unpack() [6/36]

virtual void unpack ( int &  d)
pure virtual

Unpacks an int.

◆ unpack() [7/36]

virtual void unpack ( unsigned int &  d)
pure virtual

Unpacks an unsigned int.

◆ unpack() [8/36]

virtual void unpack ( long &  d)
pure virtual

Unpacks a long.

◆ unpack() [9/36]

virtual void unpack ( unsigned long &  d)
pure virtual

Unpacks an unsigned long.

◆ unpack() [10/36]

virtual void unpack ( long long &  d)
pure virtual

Unpacks a long long.

◆ unpack() [11/36]

virtual void unpack ( unsigned long long &  d)
pure virtual

Unpacks an unsigned long long.

◆ unpack() [12/36]

virtual void unpack ( float &  d)
pure virtual

Unpacks a float.

◆ unpack() [13/36]

virtual void unpack ( double &  d)
pure virtual

Unpacks a double.

◆ unpack() [14/36]

virtual void unpack ( long double &  d)
pure virtual

Unpacks a long double.

◆ unpack() [15/36]

void unpack ( char *&  d)
inline

Unpacks a string – storage will be allocated for it via new char[].

References cCommBuffer::unpack().

Referenced by cCommBuffer::unpack().

◆ unpack() [16/36]

virtual void unpack ( const char *&  d)
pure virtual

Unpacks a string – storage will be allocated for it via new char[].

◆ unpack() [17/36]

virtual void unpack ( opp_string d)
pure virtual

Unpacks an opp_string.

◆ unpack() [18/36]

virtual void unpack ( SimTime d)
pure virtual

Unpacks a SimTime.

◆ unpack() [19/36]

virtual void unpack ( char *  d,
int  size 
)
pure virtual

Unpacks an array of chars.

◆ unpack() [20/36]

virtual void unpack ( unsigned char *  d,
int  size 
)
pure virtual

Unpacks an array of unsigned chars.

◆ unpack() [21/36]

virtual void unpack ( bool *  d,
int  size 
)
pure virtual

Unpacks an array of bools.

◆ unpack() [22/36]

virtual void unpack ( short *  d,
int  size 
)
pure virtual

Unpacks an array of shorts.

◆ unpack() [23/36]

virtual void unpack ( unsigned short *  d,
int  size 
)
pure virtual

Unpacks an array of unsigned shorts.

◆ unpack() [24/36]

virtual void unpack ( int *  d,
int  size 
)
pure virtual

Unpacks an array of ints.

◆ unpack() [25/36]

virtual void unpack ( unsigned int *  d,
int  size 
)
pure virtual

Unpacks an array of unsigned ints.

◆ unpack() [26/36]

virtual void unpack ( long *  d,
int  size 
)
pure virtual

Unpacks an array of longs.

◆ unpack() [27/36]

virtual void unpack ( unsigned long *  d,
int  size 
)
pure virtual

Unpacks an array of unsigned longs.

◆ unpack() [28/36]

virtual void unpack ( long long *  d,
int  size 
)
pure virtual

Unpacks an array of long long's.

◆ unpack() [29/36]

virtual void unpack ( unsigned long long *  d,
int  size 
)
pure virtual

Unpacks an array of unsigned long long's.

◆ unpack() [30/36]

virtual void unpack ( float *  d,
int  size 
)
pure virtual

Unpacks an array of floats.

◆ unpack() [31/36]

virtual void unpack ( double *  d,
int  size 
)
pure virtual

Unpacks an array of doubles.

◆ unpack() [32/36]

virtual void unpack ( long double *  d,
int  size 
)
pure virtual

Unpacks an array of long doubles.

◆ unpack() [33/36]

void unpack ( char **  d,
int  size 
)
inline

Unpacks an array of strings – storage for strings will be allocated via new char[].

References cCommBuffer::unpack().

Referenced by cCommBuffer::unpack().

◆ unpack() [34/36]

virtual void unpack ( const char **  d,
int  size 
)
pure virtual

Unpacks an array of strings – storage for strings will be allocated via new char[].

◆ unpack() [35/36]

virtual void unpack ( opp_string d,
int  size 
)
pure virtual

Unpacks an array of opp_strings.

◆ unpack() [36/36]

virtual void unpack ( SimTime d,
int  size 
)
pure virtual

Unpacks an array of SimTime.

◆ packFlag()

bool packFlag ( bool  flag)
inline

Stores and returns the given flag.

◆ checkFlag()

bool checkFlag ( )
inline

Unpacks and returns a bool flag stored by packFlag().

◆ packObject()

virtual void packObject ( cObject obj)
virtual

Packs an object.

◆ unpackObject()

virtual cObject* unpackObject ( )
virtual

Unpacks and returns an object.


The documentation for this class was generated from the following file: