ESyS-Particle  4.0.1
Public Member Functions | Protected Member Functions
TML_PackedMultiMessage Class Reference

Message buffer for sending and receiving packed data to mutltiple receivers. Data types are not checked. The implementation has been derived from the old CMPIVarSGBufferRoot class. More...

#include <packed_multi_message.h>

List of all members.

Public Member Functions

 TML_PackedMultiMessage (MPI_Comm, int isize=64)
TML_PackedMultiMessageSlab operator[] (int)
char * buffer ()
int * offsets ()
int * sizes ()
void clear ()
void begin_pack (int)
void begin_unpack (int)
void append (int, int)
void append (double, int)
void append (const string &, int)
void append (bool, int)
int pop_int (int)
double pop_double (int)
string pop_string (int)
bool pop_bool (int)

Protected Member Functions

void grow ()
void growTo (int)

Detailed Description

Message buffer for sending and receiving packed data to mutltiple receivers. Data types are not checked. The implementation has been derived from the old CMPIVarSGBufferRoot class.


Constructor & Destructor Documentation

TML_PackedMultiMessage::TML_PackedMultiMessage ( MPI_Comm  comm,
int  isize = 64 
)

Constructor for TML_PackedMultiMessage

Parameters:
commthe MPI communicator
isizeinitial buffer size per slice, default 64 byte

Member Function Documentation

void TML_PackedMultiMessage::append ( int  i,
int  nslice 
)

Append an integer to a given slice of the buffer.

Parameters:
ithe integer
nslicethe nr. of the slice
Warning:
No check for overflow

References grow().

Referenced by TML_PackedMultiMessageSlab::append(), and append().

Here is the call graph for this function:

Here is the caller graph for this function:

void TML_PackedMultiMessage::append ( double  d,
int  nslice 
)

Append a double to a given slice of the buffer.

Parameters:
dthe double
nslicethe nr. of the slice
Warning:
No check for overflow

References grow().

Here is the call graph for this function:

void TML_PackedMultiMessage::append ( const string &  str,
int  nslice 
)

Append a STL-string to a given slice of the buffer.

Parameters:
strthe string
nslicethe nr. of the slice
Warning:
No check for overflow

References grow().

Here is the call graph for this function:

void TML_PackedMultiMessage::append ( bool  b,
int  nslice 
)

Append boolean value to a given slice of the buffer.

Parameters:
bthe boolean
nslicethe nr. of the slice

References append().

Here is the call graph for this function:

reset single packing posn to 0

Referenced by TML_PackedMultiMessageSlab::begin_pack().

Here is the caller graph for this function:

reset single unpacking posn to 0

Referenced by TML_PackedMultiMessageSlab::begin_unpack().

Here is the caller graph for this function:

clear message buffer, i.e. reset all positions to 0

void TML_PackedMultiMessage::grow ( ) [protected]

Grows the buffer to twice its current size, thus guaranteeing that append works in amortized constant time. Currently grows the buffer homogeneously, i.e. all slices have the same size.

Warning:
no check if there is enough space for the new buffer

Referenced by append().

Here is the caller graph for this function:

void TML_PackedMultiMessage::growTo ( int  size) [protected]

Grow buffer to a specified size

Parameters:
sizethe size to grow to
TML_PackedMultiMessageSlab TML_PackedMultiMessage::operator[] ( int  i)

return a slab

bool TML_PackedMultiMessage::pop_bool ( int  nslice)

Pops a boolean from a given slice of the the buffer, i.e. it pops the last sizeof(MPI_INT) bytes of the buffer, interpreting them as a boolean (via pop_int()).

Parameters:
nslicethe nr. of the slice
Returns:
the boolean value
Warning:
No check for underflow

References pop_int().

Referenced by TML_PackedMultiMessageSlab::pop_bool().

Here is the call graph for this function:

Here is the caller graph for this function:

double TML_PackedMultiMessage::pop_double ( int  nslice)

Pops a double from a given slice of the the buffer.

Parameters:
nslicethe nr. of the slice
Returns:
the double.
Warning:
No check for underflow

Referenced by TML_PackedMultiMessageSlab::pop_double(), and TML_PackedMultiMessageSlab::pop_vec3().

Here is the caller graph for this function:

int TML_PackedMultiMessage::pop_int ( int  nslice)

Pops an integer from a given slice of the the buffer, i.e. it pops the last sizeof(MPI_INT) bytes of the buffer, interpreting them as an int.

Parameters:
nslicethe nr. of the slice
Returns:
the int.
Warning:
No check for underflow

Referenced by pop_bool(), and TML_PackedMultiMessageSlab::pop_int().

Here is the caller graph for this function:

string TML_PackedMultiMessage::pop_string ( int  nslice)

Pops a string from a given slice of the the buffer.

Parameters:
nslicethe nr. of the slice
Returns:
the string.
Warning:
Not implemented
Todo:
implement

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