IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
IBTK::StreamableManager Class Reference

Class StreamableManager is a singleton manager class that organizes the actual packing and unpacking of concrete Streamable objects for SAMRAI::tbox::AbstractStream based communication. More...

#include </home/runner/work/IBAMR/IBAMR/ibtk/include/ibtk/StreamableManager.h>

Public Member Functions

bool checkFactoryRegistration (SAMRAI::tbox::Pointer< StreamableFactory > factory)
 
int registerFactory (SAMRAI::tbox::Pointer< StreamableFactory > factory)
 
size_t getDataStreamSize (SAMRAI::tbox::Pointer< Streamable > data_item) const
 Return an upper bound on the amount of space required to pack a Streamable object to a buffer.
 
size_t getDataStreamSize (const std::vector< SAMRAI::tbox::Pointer< Streamable > > &data_items) const
 Return an upper bound on the amount of space required to pack a vector of Streamable objects to a buffer.
 
void packStream (SAMRAI::tbox::AbstractStream &stream, SAMRAI::tbox::Pointer< Streamable > data_item)
 Pack a Streamable object into the output stream.
 
void packStream (SAMRAI::tbox::AbstractStream &stream, std::vector< SAMRAI::tbox::Pointer< Streamable > > &data_items)
 Pack a vector of Streamable objects into the output stream.
 
SAMRAI::tbox::Pointer< StreamableunpackStream (SAMRAI::tbox::AbstractStream &stream, const SAMRAI::hier::IntVector< NDIM > &offset)
 Unpack a Streamable object from the data stream.
 
void unpackStream (SAMRAI::tbox::AbstractStream &stream, const SAMRAI::hier::IntVector< NDIM > &offset, std::vector< SAMRAI::tbox::Pointer< Streamable > > &data_items)
 Unpack a vector of Streamable objects from the data stream.
 

Static Public Member Functions

static StreamableManagergetManager ()
 
static void freeManager ()
 
static int getUnregisteredID ()
 

Protected Member Functions

 StreamableManager ()
 Constructor.
 
 ~StreamableManager ()
 Destructor.
 

Static Protected Member Functions

static int createUniqueID ()
 

Detailed Description

Class StreamableManager is a singleton manager class that organizes the actual packing and unpacking of concrete Streamable objects for SAMRAI::tbox::AbstractStream based communication.

See also
Streamable
StreamableFactory

Member Function Documentation

◆ checkFactoryRegistration()

bool IBTK::StreamableManager::checkFactoryRegistration ( SAMRAI::tbox::Pointer< StreamableFactory factory)

Check to see if a StreamableFactory has been registered with the manager.

Returns
true if the factory has been registered, false otherwise.
Note
This method simply checks to see if a StreamableFactory with the same Streamable ID has been registered with the manager. Every different Streamable/StreamableFactory type must have a unique ID.

◆ createUniqueID()

int IBTK::StreamableManager::createUniqueID ( )
staticprotected

Generate a unique ID number.

Every call to createUniqueID() returns a different integer, simplifying the task of generating ID numbers for StreamableFactory objects.

◆ freeManager()

void IBTK::StreamableManager::freeManager ( )
static

Deallocate the StreamableManager instance.

It is not necessary to call this function at program termination, since it is automatically called by the ShutdownRegistry class.

◆ getManager()

StreamableManager * IBTK::StreamableManager::getManager ( )
static

Return a pointer to the instance of the Streamable manager. All access to the singleton StreamableManager object is through the getManager() function.

Note that when the manager is accessed for the first time, the freeManager static method is registered with the ShutdownRegistry class. Consequently, an allocated manager is freed at program completion. Thus, users of this class do not explicitly allocate or deallocate the manager instances.

Returns
A pointer to the data manager instance.

◆ getUnregisteredID()

int IBTK::StreamableManager::getUnregisteredID ( )
static
Returns
A integer value reserved for unregistered StreamableFactory objects. A concrete StreamableFactory object must use this as its initial streamable ID.

◆ registerFactory()

int IBTK::StreamableManager::registerFactory ( SAMRAI::tbox::Pointer< StreamableFactory factory)

Register a StreamableFactory with the manager.

Each factory object registered with the manager is provided with a unique ID.

Note
To ensure that each MPI process uses the same streamable ID for each streamable class registered with the manager, this method is collective on all MPI processes!

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