|
IBAMR
IBAMR version 0.19.
|
#include <tbox/MessageStream.h>

Public Types | |
| enum | StreamMode { Read, Write } |
Public Member Functions | |
| MessageStream () | |
| MessageStream (const int bytes, const StreamMode mode) | |
| MessageStream (const int bytes, const StreamMode mode, const bool use_xdr) | |
| MessageStream (const MessageStream &)=default | |
| MessageStream & | operator= (const MessageStream &)=default |
| MessageStream (MessageStream &&)=default | |
| MessageStream & | operator= (MessageStream &&)=default |
| virtual | ~MessageStream () |
| void * | getBufferStart () |
| int | getCurrentSize () const |
| int | getCurrentIndex () const |
| void | setCurrentIndex (const int index) |
| void | resetIndex () |
Boolean Stream Primitives | |
Pack and unpack booleans into and out of the message stream. | |
| virtual AbstractStream & | operator<< (const bool &data) |
| Pack a single bool into the message stream. More... | |
| virtual AbstractStream & | operator>> (bool &data) |
| Remove a single bool from the message stream. More... | |
| virtual void | pack (const bool *data, const int n=1) |
| Pack an array of bools into the message stream. More... | |
| virtual void | unpack (bool *data, const int n=1) |
| Remove an array of bools from the message stream. More... | |
Character Stream Primitives | |
Pack and unpack chars into and out of the message stream. | |
| virtual AbstractStream & | operator<< (const char &data) |
| Pack a single char into the message stream. More... | |
| virtual AbstractStream & | operator>> (char &data) |
| Remove a single char from the message stream. More... | |
| virtual void | pack (const char *data, const int n=1) |
| Pack an array of chars into the message stream. More... | |
| virtual void | unpack (char *data, const int n=1) |
| Remove an array of chars from the message stream. More... | |
Double Complex Stream Primitives | |
Pack and unpack double complex into and out of the message stream. | |
| virtual AbstractStream & | operator<< (const dcomplex &data) |
| Pack a single double complex into the message stream. More... | |
| virtual AbstractStream & | operator>> (dcomplex &data) |
| Remove a single double complex from the message stream. More... | |
| virtual void | pack (const dcomplex *data, const int n=1) |
| Pack an array of double complex into the message stream. More... | |
| virtual void | unpack (dcomplex *data, const int n=1) |
| Remove an array of double complex from the message stream. More... | |
Double Stream Primitives | |
Pack and unpack doubles into and out of the message stream. | |
| virtual AbstractStream & | operator<< (const double &data) |
| Pack a single double into the message stream. More... | |
| virtual AbstractStream & | operator>> (double &data) |
| Remove a single double from the message stream. More... | |
| virtual void | pack (const double *data, const int n=1) |
| Pack an array of doubles into the message stream. More... | |
| virtual void | unpack (double *data, const int n=1) |
| Remove an array of doubles from the message stream. More... | |
Float Stream Primitives | |
Pack and unpack floats into and out of the message stream. | |
| virtual AbstractStream & | operator<< (const float &data) |
| Pack a single float into the message stream. More... | |
| virtual AbstractStream & | operator>> (float &data) |
| Remove a single float from the message stream. More... | |
| virtual void | pack (const float *data, const int n=1) |
| Pack an array of floats into the message stream. More... | |
| virtual void | unpack (float *data, const int n=1) |
| Remove an array of floats from the message stream. More... | |
Integer Stream Primitives | |
Pack and unpack integers into and out of the message stream. | |
| virtual AbstractStream & | operator<< (const int &data) |
| Pack a single integer into the message stream. More... | |
| virtual AbstractStream & | operator>> (int &data) |
| Remove a single integer from the message stream. More... | |
| virtual void | pack (const int *data, const int n=1) |
| Pack an array of integers into the message stream. More... | |
| virtual void | unpack (int *data, const int n=1) |
| Remove an array of integers from the message stream. More... | |
Static Public Member Functions | |
| static void | useXDR (const bool flag) |
Stream Space Calculation Primitives | |
Calculate the stream space needed for various data types. | |
| static int | sizeofBool (const int n=1) |
| Calculate the stream space needed for n bools. More... | |
| static int | sizeofChar (const int n=1) |
| Calculate the stream space needed for n chars. More... | |
| static int | sizeofDoubleComplex (const int n=1) |
| Calculate the stream space needed for n double complex. More... | |
| static int | sizeofDouble (const int n=1) |
| Calculate the stream space needed for n doubles. More... | |
| static int | sizeofFloat (const int n=1) |
| Calculate the stream space needed for n floats. More... | |
| static int | sizeofInt (const int n=1) |
| Calculate the stream space needed for n ints. More... | |
Stream Space Calculation Primitives | |
Calculate the stream space needed for various data types. | |
| static int | sizeofBool (const int n=1) |
| Calculate the stream space needed for n bools. More... | |
| static int | sizeofChar (const int n=1) |
| Calculate the stream space needed for n chars. More... | |
| static int | sizeofDoubleComplex (const int n=1) |
| Calculate the stream space needed for n double complex. More... | |
| static int | sizeofDouble (const int n=1) |
| Calculate the stream space needed for n doubles. More... | |
| static int | sizeofFloat (const int n=1) |
| Calculate the stream space needed for n floats. More... | |
| static int | sizeofInt (const int n=1) |
| Calculate the stream space needed for n ints. More... | |
Stream Space Calculation Primitives | |
Calculate the stream space needed for various data types. | |
| static int | sizeofBool (const int n=1) |
| Calculate the stream space needed for n bools. More... | |
| static int | sizeofChar (const int n=1) |
| Calculate the stream space needed for n chars. More... | |
| static int | sizeofDoubleComplex (const int n=1) |
| Calculate the stream space needed for n double complex. More... | |
| static int | sizeofDouble (const int n=1) |
| Calculate the stream space needed for n doubles. More... | |
| static int | sizeofFloat (const int n=1) |
| Calculate the stream space needed for n floats. More... | |
| static int | sizeofInt (const int n=1) |
| Calculate the stream space needed for n ints. More... | |
Stream Space Calculation Primitives | |
Calculate the stream space needed for various data types. | |
| static int | sizeofBool (const int n=1) |
| Calculate the stream space needed for n bools. More... | |
| static int | sizeofChar (const int n=1) |
| Calculate the stream space needed for n chars. More... | |
| static int | sizeofDoubleComplex (const int n=1) |
| Calculate the stream space needed for n double complex. More... | |
| static int | sizeofDouble (const int n=1) |
| Calculate the stream space needed for n doubles. More... | |
| static int | sizeofFloat (const int n=1) |
| Calculate the stream space needed for n floats. More... | |
| static int | sizeofInt (const int n=1) |
| Calculate the stream space needed for n ints. More... | |
Stream Space Calculation Primitives | |
Calculate the stream space needed for various data types. | |
| static int | sizeofBool (const int n=1) |
| Calculate the stream space needed for n bools. More... | |
| static int | sizeofChar (const int n=1) |
| Calculate the stream space needed for n chars. More... | |
| static int | sizeofDoubleComplex (const int n=1) |
| Calculate the stream space needed for n double complex. More... | |
| static int | sizeofDouble (const int n=1) |
| Calculate the stream space needed for n doubles. More... | |
| static int | sizeofFloat (const int n=1) |
| Calculate the stream space needed for n floats. More... | |
| static int | sizeofInt (const int n=1) |
| Calculate the stream space needed for n ints. More... | |
Static Private Member Functions | |
Integer Stream Primitives | |
Pack and unpack integers into and out of the abstract stream. | |
| static int | roundXDR (const int n) |
Integer Stream Primitives | |
Pack and unpack integers into and out of the abstract stream. | |
| static int | roundXDR (const int n) |
Integer Stream Primitives | |
Pack and unpack integers into and out of the abstract stream. | |
| static int | roundXDR (const int n) |
Integer Stream Primitives | |
Pack and unpack integers into and out of the abstract stream. | |
| static int | roundXDR (const int n) |
ArrayData Primitives | |
Pack and unpack ArrayData into and out of the message stream. | |
| int | d_current_size |
| int | d_buffer_index |
| int | d_use_xdr |
| tbox::Array< char > | d_buffer |
| static bool | s_use_xdr_translation |
| template<int DIM, class TYPE > | |
| void | packArrayData (const pdat::ArrayData< DIM, TYPE > &arraydata, const hier::Box< DIM > &dest_box, const hier::IntVector< DIM > &src_shift) |
| template<int DIM, class TYPE > | |
| void | unpackArrayData (pdat::ArrayData< DIM, TYPE > &arraydata, const hier::Box< DIM > &dest_box, const hier::IntVector< DIM > &src_shift) |
| template<int DIM, class TYPE > | |
| void | unpackAndSumArrayData (pdat::ArrayData< DIM, TYPE > &arraydata, const hier::Box< DIM > &dest_box, const hier::IntVector< DIM > &src_shift) |
| virtual void | printClassData (std::ostream &os) const |
| void * | getPointerAndAdvanceCursor (const int bytes) |
Class MessageStream implements a message buffer of fixed size used by the communication routines. It is a subclass of AbstractStream. Class MessageStream defines two mechanisms can be used to pack or unpack a message stream: (1) XDR and (2) a straight-forward byte copy. XDR has the advantage of machine independence for heterogenous networks but is much slower than a simple copy.
| SAMRAI::tbox::MessageStream::MessageStream | ( | ) |
Default constructor. Sets up an empty message.
| SAMRAI::tbox::MessageStream::MessageStream | ( | const int | bytes, |
| const StreamMode | mode | ||
| ) |
Create a message stream of the specified size in bytes and the stream mode (one of MessageStream::Read or MessageStream::Write). The choice of XDR translation is based on the current value of the class-wide useXDR() flag.
| SAMRAI::tbox::MessageStream::MessageStream | ( | const int | bytes, |
| const StreamMode | mode, | ||
| const bool | use_xdr | ||
| ) |
Create a message stream of the specified size in bytes and the stream mode (either MessageStream::Read or MessageStream::Write). The choice of XDR translation is based on the argument to the constructor, which is independent of the class-wide XDR flag.
|
default |
Copy constructor.
|
default |
Move constructor.
|
virtual |
Virtual destructor for a message stream.
|
default |
Copy assignment operator.
|
default |
Move assignment operator.
|
static |
| void* SAMRAI::tbox::MessageStream::getBufferStart | ( | ) |
Return a pointer to the start of the message buffer.
| int SAMRAI::tbox::MessageStream::getCurrentSize | ( | ) | const |
Return the current size of the buffer in bytes.
| int SAMRAI::tbox::MessageStream::getCurrentIndex | ( | ) | const |
Return the current index into the buffer.
| void SAMRAI::tbox::MessageStream::setCurrentIndex | ( | const int | index | ) |
Set the current index into the buffer. Further packing/unpacking will begin at this new location.
| void SAMRAI::tbox::MessageStream::resetIndex | ( | ) |
Reset the index to the beginning of the buffer. This is the same as setting the buffer index to zero via setCurrentIndex().
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
|
virtual |
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
Implements SAMRAI::tbox::AbstractStream.
| void SAMRAI::tbox::MessageStream::packArrayData | ( | const pdat::ArrayData< DIM, TYPE > & | arraydata, |
| const hier::Box< DIM > & | dest_box, | ||
| const hier::IntVector< DIM > & | src_shift | ||
| ) |
| void SAMRAI::tbox::MessageStream::unpackArrayData | ( | pdat::ArrayData< DIM, TYPE > & | arraydata, |
| const hier::Box< DIM > & | dest_box, | ||
| const hier::IntVector< DIM > & | src_shift | ||
| ) |
| void SAMRAI::tbox::MessageStream::unpackAndSumArrayData | ( | pdat::ArrayData< DIM, TYPE > & | arraydata, |
| const hier::Box< DIM > & | dest_box, | ||
| const hier::IntVector< DIM > & | src_shift | ||
| ) |
|
virtual |
Print out internal class data for debugging.
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
1.8.17