IBAMR  IBAMR version 0.19.
Public Member Functions | List of all members
IBTK::FixedSizedStream Class Reference

Class FixedSizedStream provides a fixed-size message buffer used by various communication routines. More...

#include <ibtk/FixedSizedStream.h>

Inheritance diagram for IBTK::FixedSizedStream:
Inheritance graph
[legend]

Public Member Functions

 FixedSizedStream (int bytes)
 
 FixedSizedStream (const void *buffer, int bytes)
 
 ~FixedSizedStream ()=default
 
void * getBufferStart ()
 
const void * getBufferStart () const
 
int getCurrentSize () const
 
int getCurrentIndex () const
 
void setCurrentIndex (int index)
 
void resetIndex ()
 
Boolean Stream Primitives

Pack and unpack booleans into and out of the message stream.

SAMRAI::tbox::AbstractStreamoperator<< (const bool &data) override
 
SAMRAI::tbox::AbstractStreamoperator>> (bool &data) override
 
void pack (const bool *data, int n=1) override
 
void unpack (bool *data, int n=1) override
 
Character Stream Primitives

Pack and unpack chars into and out of the message stream.

SAMRAI::tbox::AbstractStreamoperator<< (const char &data) override
 
SAMRAI::tbox::AbstractStreamoperator>> (char &data) override
 
void pack (const char *data, int n=1) override
 
void unpack (char *data, int n=1) override
 
Double Complex Stream Primitives

Pack and unpack double complex into and out of the message stream.

SAMRAI::tbox::AbstractStreamoperator<< (const dcomplex &data) override
 
SAMRAI::tbox::AbstractStreamoperator>> (dcomplex &data) override
 
void pack (const dcomplex *data, int n=1) override
 
void unpack (dcomplex *data, int n=1) override
 
Double Stream Primitives

Pack and unpack doubles into and out of the message stream.

SAMRAI::tbox::AbstractStreamoperator<< (const double &data) override
 
SAMRAI::tbox::AbstractStreamoperator>> (double &data) override
 
void pack (const double *data, int n=1) override
 
void unpack (double *data, int n=1) override
 
Float Stream Primitives

Pack and unpack floats into and out of the message stream.

SAMRAI::tbox::AbstractStreamoperator<< (const float &data) override
 
SAMRAI::tbox::AbstractStreamoperator>> (float &data) override
 
void pack (const float *data, int n=1) override
 
void unpack (float *data, int n=1) override
 

Integer Stream Primitives

Pack and unpack integers into and out of the message stream.

const int d_buffer_size
 
int d_current_size = 0
 
int d_buffer_index = 0
 
std::vector< char > d_buffer
 
SAMRAI::tbox::AbstractStreamoperator<< (const int &data) override
 
SAMRAI::tbox::AbstractStreamoperator>> (int &data) override
 
void pack (const int *data, int n=1) override
 
void unpack (int *data, int n=1) override
 
 FixedSizedStream ()=delete
 Default constructor. More...
 
 FixedSizedStream (const FixedSizedStream &from)=delete
 Copy constructor. More...
 
FixedSizedStreamoperator= (const FixedSizedStream &that)=delete
 Assignment operator. More...
 
void * getPointerAndAdvanceCursor (int bytes)
 Return a pointer to buffer space and advance internal pointers to reflect the allocated buffers space. More...
 
template<typename T >
void __pack (const T *m_data, unsigned int m_bytes)
 Pack the specified data to the buffer. More...
 
template<typename T >
void __unpack (T *m_data, unsigned int m_bytes)
 Unpack the specified data from the buffer. More...
 

Detailed Description

This class implements the SAMRAI::tbox::AbstractStream interface. Class FixedSizedStream can packs and unpacks message streams via straight-forward byte copying.

Warning
This class stores and communicates values in the native binary machine format. Consequently, this implementation is not suitable for heterogeneous networks, which require a machine-independent storage format such as XDR.

Constructor & Destructor Documentation

◆ FixedSizedStream() [1/4]

IBTK::FixedSizedStream::FixedSizedStream ( int  bytes)

Create a message stream of the specified size in bytes.

◆ FixedSizedStream() [2/4]

IBTK::FixedSizedStream::FixedSizedStream ( const void *  buffer,
int  bytes 
)

Create a message stream with the specified buffer.

◆ ~FixedSizedStream()

IBTK::FixedSizedStream::~FixedSizedStream ( )
default

Destructor for a message stream.

◆ FixedSizedStream() [3/4]

IBTK::FixedSizedStream::FixedSizedStream ( )
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

◆ FixedSizedStream() [4/4]

IBTK::FixedSizedStream::FixedSizedStream ( const FixedSizedStream from)
privatedelete
Note
This constructor is not implemented and should not be used.
Parameters
fromThe value to copy to this object.

Member Function Documentation

◆ getBufferStart() [1/2]

const void * IBTK::FixedSizedStream::getBufferStart ( )
inline

Return a pointer to the start of the message buffer.

◆ getBufferStart() [2/2]

const void* IBTK::FixedSizedStream::getBufferStart ( ) const

Return a const pointer to the start of the message buffer.

◆ getCurrentSize()

int IBTK::FixedSizedStream::getCurrentSize ( ) const
inline

Return the current size of the buffer in bytes.

◆ getCurrentIndex()

int IBTK::FixedSizedStream::getCurrentIndex ( ) const
inline

Return the current index into the buffer.

◆ setCurrentIndex()

void IBTK::FixedSizedStream::setCurrentIndex ( int  index)
inline

Set the current index into the buffer. Further packing/unpacking will begin at this new location.

◆ resetIndex()

void IBTK::FixedSizedStream::resetIndex ( )
inline

Reset the index to the beginning of the buffer. This is the same as setting the buffer index to zero via setCurrentIndex().

◆ operator<<() [1/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator<< ( const bool data)
inlineoverridevirtual

Pack a single bool into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator>>() [1/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator>> ( bool data)
inlineoverridevirtual

Remove a single bool from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ pack() [1/6]

void IBTK::FixedSizedStream::pack ( const bool data,
int  n = 1 
)
inlineoverridevirtual

Pack an array of bools into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ unpack() [1/6]

void IBTK::FixedSizedStream::unpack ( bool data,
int  n = 1 
)
inlineoverridevirtual

Remove an array of bools from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator<<() [2/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator<< ( const char &  data)
inlineoverridevirtual

Pack a single char into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator>>() [2/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator>> ( char &  data)
inlineoverridevirtual

Remove a single char from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ pack() [2/6]

void IBTK::FixedSizedStream::pack ( const char *  data,
int  n = 1 
)
inlineoverridevirtual

Pack an array of chars into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ unpack() [2/6]

void IBTK::FixedSizedStream::unpack ( char *  data,
int  n = 1 
)
inlineoverridevirtual

Remove an array of chars from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator<<() [3/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator<< ( const dcomplex data)
inlineoverridevirtual

Pack a single double complex into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator>>() [3/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator>> ( dcomplex data)
inlineoverridevirtual

Remove a single double complex from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ pack() [3/6]

void IBTK::FixedSizedStream::pack ( const dcomplex data,
int  n = 1 
)
inlineoverridevirtual

Pack an array of double complex into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ unpack() [3/6]

void IBTK::FixedSizedStream::unpack ( dcomplex data,
int  n = 1 
)
inlineoverridevirtual

Remove an array of double complex from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator<<() [4/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator<< ( const double data)
inlineoverridevirtual

Pack a single double into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator>>() [4/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator>> ( double data)
inlineoverridevirtual

Remove a single double from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ pack() [4/6]

void IBTK::FixedSizedStream::pack ( const double data,
int  n = 1 
)
inlineoverridevirtual

Pack an array of doubles into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ unpack() [4/6]

void IBTK::FixedSizedStream::unpack ( double data,
int  n = 1 
)
inlineoverridevirtual

Remove an array of doubles from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator<<() [5/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator<< ( const float &  data)
inlineoverridevirtual

Pack a single float into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator>>() [5/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator>> ( float &  data)
inlineoverridevirtual

Remove a single float from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ pack() [5/6]

void IBTK::FixedSizedStream::pack ( const float *  data,
int  n = 1 
)
inlineoverridevirtual

Pack an array of floats into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ unpack() [5/6]

void IBTK::FixedSizedStream::unpack ( float *  data,
int  n = 1 
)
inlineoverridevirtual

Remove an array of floats from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator<<() [6/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator<< ( const int data)
inlineoverridevirtual

Pack a single integer into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator>>() [6/6]

SAMRAI::tbox::AbstractStream & IBTK::FixedSizedStream::operator>> ( int data)
inlineoverridevirtual

Remove a single integer from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ pack() [6/6]

void IBTK::FixedSizedStream::pack ( const int data,
int  n = 1 
)
inlineoverridevirtual

Pack an array of integers into the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ unpack() [6/6]

void IBTK::FixedSizedStream::unpack ( int data,
int  n = 1 
)
inlineoverridevirtual

Remove an array of integers from the message stream.

Implements SAMRAI::tbox::AbstractStream.

◆ operator=()

FixedSizedStream& IBTK::FixedSizedStream::operator= ( const FixedSizedStream that)
privatedelete
Note
This operator is not implemented and should not be used.
Parameters
thatThe value to assign to this object.
Returns
A reference to this object.

◆ getPointerAndAdvanceCursor()

void * IBTK::FixedSizedStream::getPointerAndAdvanceCursor ( int  bytes)
inlineprivate

◆ __pack()

template<typename T >
void IBTK::FixedSizedStream::__pack ( const T *  m_data,
unsigned int  m_bytes 
)
inlineprivate

◆ __unpack()

template<typename T >
void IBTK::FixedSizedStream::__unpack ( T *  m_data,
unsigned int  m_bytes 
)
inlineprivate

◆ sizeofBool()

static int SAMRAI::tbox::AbstractStream::sizeofBool ( const int  n = 1)
staticinherited

◆ sizeofChar()

static int SAMRAI::tbox::AbstractStream::sizeofChar ( const int  n = 1)
staticinherited

◆ sizeofDoubleComplex()

static int SAMRAI::tbox::AbstractStream::sizeofDoubleComplex ( const int  n = 1)
staticinherited

◆ sizeofDouble()

static int SAMRAI::tbox::AbstractStream::sizeofDouble ( const int  n = 1)
staticinherited

◆ sizeofFloat()

static int SAMRAI::tbox::AbstractStream::sizeofFloat ( const int  n = 1)
staticinherited

◆ sizeofInt()

static int SAMRAI::tbox::AbstractStream::sizeofInt ( const int  n = 1)
staticinherited

◆ roundXDR()

static int SAMRAI::tbox::AbstractStream::roundXDR ( const int  n)
staticprivateinherited

Member Data Documentation

◆ d_buffer_size

const int IBTK::FixedSizedStream::d_buffer_size
private

◆ d_current_size

int IBTK::FixedSizedStream::d_current_size = 0
private

◆ d_buffer_index

int IBTK::FixedSizedStream::d_buffer_index = 0
private

◆ d_buffer

std::vector<char> IBTK::FixedSizedStream::d_buffer
private

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