IBAMR  IBAMR version 0.20.
Public Member Functions | List of all members
SAMRAI::tbox::AbstractStream Class Referenceabstract

#include <tbox/AbstractStream.h>

Inheritance diagram for SAMRAI::tbox::AbstractStream:
Inheritance graph
[legend]

Public Member Functions

 AbstractStream ()
 
virtual ~AbstractStream ()
 
Boolean Stream Primitives

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

virtual AbstractStreamoperator<< (const bool &data)=0
 Pack a single bool into the abstract stream. More...
 
virtual AbstractStreamoperator>> (bool &data)=0
 Remove a single bool from the abstract stream. More...
 
virtual void pack (const bool *data, const int n=1)=0
 Pack an array of bools into the abstract stream. More...
 
virtual void unpack (bool *data, const int n=1)=0
 Remove an array of bools from the abstract stream. More...
 
Character Stream Primitives

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

virtual AbstractStreamoperator<< (const char &data)=0
 Pack a single char into the abstract stream. More...
 
virtual AbstractStreamoperator>> (char &data)=0
 Remove a single char from the abstract stream. More...
 
virtual void pack (const char *data, const int n=1)=0
 Pack an array of chars into the abstract stream. More...
 
virtual void unpack (char *data, const int n=1)=0
 Remove an array of chars from the abstract stream. More...
 
Double Complex Stream Primitives

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

virtual AbstractStreamoperator<< (const dcomplex &data)=0
 Pack a single double complex into the abstract stream. More...
 
virtual AbstractStreamoperator>> (dcomplex &data)=0
 Remove a single double complex from the abstract stream. More...
 
virtual void pack (const dcomplex *data, const int n=1)=0
 Pack an array of double complex into the abstract stream. More...
 
virtual void unpack (dcomplex *data, const int n=1)=0
 Remove an array of double complex from the abstract stream. More...
 
Double Stream Primitives

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

virtual AbstractStreamoperator<< (const double &data)=0
 Pack a single double into the abstract stream. More...
 
virtual AbstractStreamoperator>> (double &data)=0
 Remove a single double from the abstract stream. More...
 
virtual void pack (const double *data, const int n=1)=0
 Pack an array of doubles into the abstract stream. More...
 
virtual void unpack (double *data, const int n=1)=0
 Remove an array of doubles from the abstract stream. More...
 
Float Stream Primitives

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

virtual AbstractStreamoperator<< (const float &data)=0
 Pack a single float into the abstract stream. More...
 
virtual AbstractStreamoperator>> (float &data)=0
 Remove a single float from the abstract stream. More...
 
virtual void pack (const float *data, const int n=1)=0
 Pack an array of floats into the abstract stream. More...
 
virtual void unpack (float *data, const int n=1)=0
 Remove an array of floats from the abstract stream. More...
 

Static Public Member Functions

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

Integer Stream Primitives

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

virtual AbstractStreamoperator<< (const int &data)=0
 Pack a single integer into the abstract stream. More...
 
virtual AbstractStreamoperator>> (int &data)=0
 Remove a single integer from the abstract stream. More...
 
virtual void pack (const int *data, const int n=1)=0
 Pack an array of integers into the abstract stream. More...
 
virtual void unpack (int *data, const int n=1)=0
 Remove an array of integers from the abstract stream. More...
 
static int roundXDR (const int n)
 

Detailed Description

Class AbstractStream is an abstract virtual base class that provides a stream abstraction for packing and unpacking data. Data sizes are defined to be compliant with the XDR specs (the data buffer is always four-byte aligned). This alignment may make buffers a bit larger than necessary, but allows for XDR translation.

The sizeofXXX() functions should be used to calculate the amount of buffer space needed to pack primitive data type XXX, where XXX is one of bool, char, double, float, or int.

Constructor & Destructor Documentation

◆ AbstractStream()

SAMRAI::tbox::AbstractStream::AbstractStream ( )

Default constructor for an abstract stream.

◆ ~AbstractStream()

virtual SAMRAI::tbox::AbstractStream::~AbstractStream ( )
virtual

Virtual destructor for an abstract stream.

Member Function Documentation

◆ sizeofBool()

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

◆ sizeofChar()

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

◆ sizeofDoubleComplex()

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

◆ sizeofDouble()

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

◆ sizeofFloat()

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

◆ sizeofInt()

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

◆ operator<<() [1/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator<< ( const bool &  data)
pure virtual

◆ operator>>() [1/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator>> ( bool &  data)
pure virtual

◆ pack() [1/6]

virtual void SAMRAI::tbox::AbstractStream::pack ( const bool *  data,
const int  n = 1 
)
pure virtual

◆ unpack() [1/6]

virtual void SAMRAI::tbox::AbstractStream::unpack ( bool *  data,
const int  n = 1 
)
pure virtual

◆ operator<<() [2/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator<< ( const char &  data)
pure virtual

◆ operator>>() [2/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator>> ( char &  data)
pure virtual

◆ pack() [2/6]

virtual void SAMRAI::tbox::AbstractStream::pack ( const char *  data,
const int  n = 1 
)
pure virtual

◆ unpack() [2/6]

virtual void SAMRAI::tbox::AbstractStream::unpack ( char *  data,
const int  n = 1 
)
pure virtual

◆ operator<<() [3/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator<< ( const dcomplex data)
pure virtual

◆ operator>>() [3/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator>> ( dcomplex data)
pure virtual

◆ pack() [3/6]

virtual void SAMRAI::tbox::AbstractStream::pack ( const dcomplex data,
const int  n = 1 
)
pure virtual

◆ unpack() [3/6]

virtual void SAMRAI::tbox::AbstractStream::unpack ( dcomplex data,
const int  n = 1 
)
pure virtual

◆ operator<<() [4/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator<< ( const double &  data)
pure virtual

◆ operator>>() [4/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator>> ( double &  data)
pure virtual

◆ pack() [4/6]

virtual void SAMRAI::tbox::AbstractStream::pack ( const double *  data,
const int  n = 1 
)
pure virtual

◆ unpack() [4/6]

virtual void SAMRAI::tbox::AbstractStream::unpack ( double *  data,
const int  n = 1 
)
pure virtual

◆ operator<<() [5/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator<< ( const float &  data)
pure virtual

◆ operator>>() [5/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator>> ( float &  data)
pure virtual

◆ pack() [5/6]

virtual void SAMRAI::tbox::AbstractStream::pack ( const float *  data,
const int  n = 1 
)
pure virtual

◆ unpack() [5/6]

virtual void SAMRAI::tbox::AbstractStream::unpack ( float *  data,
const int  n = 1 
)
pure virtual

◆ operator<<() [6/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator<< ( const int &  data)
pure virtual

◆ operator>>() [6/6]

virtual AbstractStream& SAMRAI::tbox::AbstractStream::operator>> ( int &  data)
pure virtual

◆ pack() [6/6]

virtual void SAMRAI::tbox::AbstractStream::pack ( const int *  data,
const int  n = 1 
)
pure virtual

◆ unpack() [6/6]

virtual void SAMRAI::tbox::AbstractStream::unpack ( int *  data,
const int  n = 1 
)
pure virtual

◆ roundXDR()

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

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