#include <BALL/CONCEPT/XDRPersistenceManager.h>
Public Member Functions | |
Constructors and Destructors | |
XDRPersistenceManager () | |
XDRPersistenceManager (std::istream &is) | |
XDRPersistenceManager (std::ostream &os) | |
XDRPersistenceManager (std::istream &is, std::ostream &os) | |
Layer 0 methods | |
virtual void | writeHeader (const char *type_name, const char *name, LongSize ptr) |
virtual bool | checkHeader (const char *type_name, const char *name, LongSize &ptr) |
virtual void | writeTrailer (const char *name=0) |
virtual bool | checkTrailer (const char *name=0) |
virtual void | writeStreamHeader () |
virtual void | writeStreamTrailer () |
virtual bool | checkStreamHeader () |
virtual bool | checkStreamTrailer () |
virtual bool | getObjectHeader (String &type_name, LongSize &ptr) |
virtual void | writeName (const char *name) |
virtual bool | checkName (const char *name) |
virtual void | writeStorableHeader (const char *type_name, const char *name) |
virtual bool | checkStorableHeader (const char *type_name, const char *name) |
virtual void | writePrimitiveHeader (const char *type_name, const char *name) |
virtual bool | checkPrimitiveHeader (const char *type_name, const char *name) |
virtual void | writeStorableTrailer () |
virtual bool | checkStorableTrailer () |
virtual void | writePrimitiveTrailer () |
virtual bool | checkPrimitiveTrailer () |
virtual void | writeObjectPointerHeader (const char *type_name, const char *name) |
virtual bool | checkObjectPointerHeader (const char *type_name, const char *name) |
virtual void | writeObjectReferenceHeader (const char *type_name, const char *name) |
virtual bool | checkObjectReferenceHeader (const char *type_name, const char *name) |
virtual void | writeObjectPointerArrayHeader (const char *type_name, const char *name, Size size) |
virtual bool | checkObjectPointerArrayHeader (const char *type_name, const char *name, Size &size) |
virtual void | writeObjectPointerArrayTrailer () |
virtual bool | checkObjectPointerArrayTrailer () |
virtual void | initializeOutputStream () |
virtual void | finalizeOutputStream () |
virtual void | initializeInputStream () |
virtual void | finalizeInputStream () |
Put methods for primitive data types. | |
virtual void | put (const char c) |
virtual void | put (const Byte b) |
virtual void | put (const Index i) |
virtual void | put (const Size s) |
virtual void | put (const bool b) |
virtual void | put (const Real f) |
virtual void | put (const DoubleReal d) |
virtual void | put (const string &s) |
virtual void | put (const LongSize p) |
Get methods for primitive data types. | |
virtual void | get (char &c) |
virtual void | get (Byte &c) |
virtual void | get (Index &s) |
virtual void | get (Size &s) |
virtual void | get (bool &b) |
virtual void | get (Real &f) |
virtual void | get (DoubleReal &d) |
virtual void | get (string &s) |
virtual void | get (LongSize &p) |
void | setHandleStreamsExternally (bool handle_externally) |
Static Public Attributes | |
Constants | |
static const Size | STREAM_HEADER |
static const Size | STREAM_TRAILER |
static const Size | OBJECT_HEADER |
static const Size | OBJECT_TRAILER |
Private Attributes | |
XDR | xdr_in_ |
XDR | xdr_out_ |
bool | streams_handled_externally_ |
XDR-format-based persistence manager. This class implements a persistence manager that reads and writes its objects in a portable binary format.
BALL::XDRPersistenceManager::XDRPersistenceManager | ( | ) |
Default constructor.
BALL::XDRPersistenceManager::XDRPersistenceManager | ( | std::istream & | is | ) |
Detailed constructor with an input stream
BALL::XDRPersistenceManager::XDRPersistenceManager | ( | std::ostream & | os | ) |
Detailed constructor with an output stream
BALL::XDRPersistenceManager::XDRPersistenceManager | ( | std::istream & | is, | |
std::ostream & | os | |||
) |
Detailed constructor with an input stream and an output stream.
virtual bool BALL::XDRPersistenceManager::checkHeader | ( | const char * | type_name, | |
const char * | name, | |||
LongSize & | ptr | |||
) | [virtual] |
Check for an object header. This method reads an int form the input stream (using xdr_int
) and returns true if the value read equals OBJECT_HEADER .
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkName | ( | const char * | name | ) | [virtual] |
Check for variable/member name.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkObjectPointerArrayHeader | ( | const char * | type_name, | |
const char * | name, | |||
Size & | size | |||
) | [virtual] |
Check for header for an array of pointers to PersistentObjects.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkObjectPointerArrayTrailer | ( | ) | [virtual] |
Check for trailer for an array of pointers to PersistentObjects.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkObjectPointerHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Check for header for a pointer to a PersistentObject.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkObjectReferenceHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Check for header for a reference to a PersistentObject.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkPrimitiveHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Check for a type header and name for a primitive type.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkPrimitiveTrailer | ( | ) | [virtual] |
Check the trailer of a primitive type.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkStorableHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Check for storable object header.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkStorableTrailer | ( | ) | [virtual] |
Check for storable object trailer.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkStreamHeader | ( | ) | [virtual] |
Check for the start marker in the input stream.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkStreamTrailer | ( | ) | [virtual] |
Check for the end marker in the output stream.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::checkTrailer | ( | const char * | name = 0 |
) | [virtual] |
Check for an object trailer. This method reads an int form the input stream (using xdr_int
) and returns true if the value read equals OBJECT_TRAILER .
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::finalizeInputStream | ( | ) | [virtual] |
Prepare the stream for closing. This method destroys the XDR output stream (using xdr_destroy).
Reimplemented from BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::finalizeOutputStream | ( | ) | [virtual] |
Prepare the stream for closing. This method destroys the XDR output stream (using xdr_destroy).
Reimplemented from BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | LongSize & | p | ) | [virtual] |
Read a pointer from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | string & | s | ) | [virtual] |
Read a string from the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | DoubleReal & | d | ) | [virtual] |
Read a double precision floating point number from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | Real & | f | ) | [virtual] |
Read a single precision floating point number from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | bool & | b | ) | [virtual] |
Read a boolean value from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | Size & | s | ) | [virtual] |
Read a Size or a Position from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | Index & | s | ) | [virtual] |
Read an Index from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | Byte & | c | ) | [virtual] |
Read a single byte from the input stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::get | ( | char & | c | ) | [virtual] |
Read a signed char from the input stream.
Implements BALL::PersistenceManager.
virtual bool BALL::XDRPersistenceManager::getObjectHeader | ( | String & | type_name, | |
LongSize & | ptr | |||
) | [virtual] |
Get an (unknown) object header.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::initializeInputStream | ( | ) | [virtual] |
Prepare the stream for output. This method creates an XDR output stream (using xdrrec_create) and prepares it for output.
Reimplemented from BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::initializeOutputStream | ( | ) | [virtual] |
Prepare the stream for output. This method creates an XDR output stream (using xdrrec_create) and prepares it for output.
Reimplemented from BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const LongSize | p | ) | [virtual] |
Write a pointer to the output.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const string & | s | ) | [virtual] |
Write a string to the output.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const DoubleReal | d | ) | [virtual] |
Write a double precision floating point number to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const Real | f | ) | [virtual] |
Write a single precision floating point number to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const bool | b | ) | [virtual] |
Write a boolean value to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const Size | s | ) | [virtual] |
Write a Size or a Position to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const Index | i | ) | [virtual] |
Write an Index to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const Byte | b | ) | [virtual] |
Write a single byte the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::put | ( | const char | c | ) | [virtual] |
Write a signed char to the output stream.
Implements BALL::PersistenceManager.
void BALL::XDRPersistenceManager::setHandleStreamsExternally | ( | bool | handle_externally | ) |
Accesssors With this method, our caller can take responsibility for initializing and destroying the XDR streams.
virtual void BALL::XDRPersistenceManager::writeHeader | ( | const char * | type_name, | |
const char * | name, | |||
LongSize | ptr | |||
) | [virtual] |
Write an object header. This method stores OBJECT_HEADER as an int value to mark the start of an object (using xdr_int
).
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeName | ( | const char * | name | ) | [virtual] |
Write a variable/member name.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeObjectPointerArrayHeader | ( | const char * | type_name, | |
const char * | name, | |||
Size | size | |||
) | [virtual] |
Write header for an array of pointers to PersistentObjects.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeObjectPointerArrayTrailer | ( | ) | [virtual] |
Write trailer for an array of pointers to PersistentObjects.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeObjectPointerHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Write header for a pointer to a PersistentObject.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeObjectReferenceHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Write header for a reference to a PersistentObject.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writePrimitiveHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Write type header and name for a primitive type.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writePrimitiveTrailer | ( | ) | [virtual] |
Write the trailer for a primitive type.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeStorableHeader | ( | const char * | type_name, | |
const char * | name | |||
) | [virtual] |
Write storable object header.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeStorableTrailer | ( | ) | [virtual] |
Write storable object trailer.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeStreamHeader | ( | ) | [virtual] |
Write a start marker to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeStreamTrailer | ( | ) | [virtual] |
Write an end marker to the output stream.
Implements BALL::PersistenceManager.
virtual void BALL::XDRPersistenceManager::writeTrailer | ( | const char * | name = 0 |
) | [virtual] |
Write an object trailer. This method stores OBJECT_TRAILER as an int value to mark the start of an object (using xdr_int
).
Implements BALL::PersistenceManager.
const Size BALL::XDRPersistenceManager::OBJECT_HEADER [static] |
A constant value used to mark the beginning of an object
const Size BALL::XDRPersistenceManager::OBJECT_TRAILER [static] |
A constant value used to mark the end of an object
const Size BALL::XDRPersistenceManager::STREAM_HEADER [static] |
A constant value used to mark the beginning of a persistent stream
const Size BALL::XDRPersistenceManager::STREAM_TRAILER [static] |
A constant value used to mark the end of a persistent stream
If this flag is set to true, we will not destroy or initialize the XDR variables automatically.
XDR BALL::XDRPersistenceManager::xdr_in_ [private] |
The XDR struct used to read from
XDR BALL::XDRPersistenceManager::xdr_out_ [private] |
The XDR struct used to write to