MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <PrepackedBuffer.h>
Public Member Functions | |
unsigned int | conv2buf (char *buf) const |
const char * | data () const |
unsigned int | dataSize () const |
bool | isVector () const |
unsigned int | numEntries () const |
const char * | operator[] (unsigned int index) const |
PrepackedBuffer (const char *data, unsigned int dataSize, unsigned int numEntries=0) | |
PrepackedBuffer (const PrepackedBuffer &other) | |
PrepackedBuffer (const char *buf) | |
PrepackedBuffer () | |
unsigned int | size () const |
~PrepackedBuffer () | |
Private Attributes | |
char * | data_ |
unsigned int | dataSize_ |
unsigned int | individualDataSize_ |
unsigned int | numEntries_ |
this class is used to take data that has already been converted into a buffer by one or more Conv<> operations, and send it between nodes. Useful when one doesn't know the data type being transferred.
Definition at line 15 of file PrepackedBuffer.h.
PrepackedBuffer::PrepackedBuffer | ( | const char * | data, |
unsigned int | dataSize, | ||
unsigned int | numEntries = 0 |
||
) |
Constructor. Here data is a pointer to the entire data block. dataSize is the size of the entire data block to be transferred, dataSize = individualDataSize * numEntries. numEntries is the # of array entries. For non-arrays it defaults to 0.
Definition at line 13 of file PrepackedBuffer.cpp.
References data_, dataSize(), dataSize_, individualDataSize_, and numEntries_.
PrepackedBuffer::PrepackedBuffer | ( | const PrepackedBuffer & | other | ) |
Definition at line 26 of file PrepackedBuffer.cpp.
References data_, dataSize_, individualDataSize_, and numEntries_.
PrepackedBuffer::PrepackedBuffer | ( | const char * | buf | ) |
Constructor Here the char buffer is a serialized version of the Prepacked buffer
Definition at line 38 of file PrepackedBuffer.cpp.
References data_, dataSize_, individualDataSize_, and numEntries_.
PrepackedBuffer::PrepackedBuffer | ( | ) |
Definition at line 51 of file PrepackedBuffer.cpp.
References data_.
PrepackedBuffer::~PrepackedBuffer | ( | ) |
Definition at line 58 of file PrepackedBuffer.cpp.
References data_.
unsigned int PrepackedBuffer::conv2buf | ( | char * | buf | ) | const |
Converts to a buffer. Buf must be preallocated.
Definition at line 70 of file PrepackedBuffer.cpp.
References data_, dataSize_, numEntries_, and size().
|
inline |
Definition at line 42 of file PrepackedBuffer.h.
References data_.
|
inline |
Returns the size of the data contents.
Definition at line 56 of file PrepackedBuffer.h.
References dataSize_.
Referenced by PrepackedBuffer().
|
inline |
Flag: is the data type a single value or a vector?
Definition at line 82 of file PrepackedBuffer.h.
References numEntries_.
|
inline |
Returns number of data entries: size of transferred array.
Definition at line 75 of file PrepackedBuffer.h.
References numEntries_.
const char * PrepackedBuffer::operator[] | ( | unsigned int | index | ) | const |
looks up entry. If index exceeds numEntries_, then goes back to beginning. Lets us tile the target with repeating sequences. Most commonly just repeat one entry.
Definition at line 63 of file PrepackedBuffer.cpp.
References data_, individualDataSize_, and numEntries_.
|
inline |
Returns the size of the entire PrepackedBuffer converted to char*
Definition at line 63 of file PrepackedBuffer.h.
References dataSize_.
Referenced by conv2buf().
|
private |
Definition at line 89 of file PrepackedBuffer.h.
Referenced by conv2buf(), data(), operator[](), PrepackedBuffer(), and ~PrepackedBuffer().
|
private |
Definition at line 86 of file PrepackedBuffer.h.
Referenced by conv2buf(), dataSize(), PrepackedBuffer(), and size().
|
private |
Definition at line 88 of file PrepackedBuffer.h.
Referenced by operator[](), and PrepackedBuffer().
|
private |
Definition at line 87 of file PrepackedBuffer.h.
Referenced by conv2buf(), isVector(), numEntries(), operator[](), and PrepackedBuffer().