Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

XDRPersistenceManager Class Reference
[Object Persistence.]

XDR-format-based persistence manager. More...

#include <XDRPersistenceManager.h>

Inheritance diagram for XDRPersistenceManager:

PersistenceManager List of all members.

Public Member Functions

Constructors and Destructors
 XDRPersistenceManager () throw ()
 Default constructor.
 XDRPersistenceManager (std::istream &is) throw ()
 Detailed constructor with an input stream.
 XDRPersistenceManager (std::ostream &os) throw ()
 Detailed constructor with an output stream.
 XDRPersistenceManager (std::istream &is, std::ostream &os) throw ()
 Detailed constructor with an input stream and an output stream.
Layer 0 methods
virtual void writeHeader (const char *type_name, const char *name, LongSize ptr) throw ()
 Write an object header.
virtual bool checkHeader (const char *type_name, const char *name, LongSize &ptr) throw ()
 Check for an object header.
virtual void writeTrailer (const char *name=0) throw ()
 Write an object trailer.
virtual bool checkTrailer (const char *name=0) throw ()
 Check for an object trailer.
virtual void writeStreamHeader () throw ()
 Write a start marker to the output stream.
virtual void writeStreamTrailer () throw ()
 Write an end marker to the output stream.
virtual bool checkStreamHeader () throw ()
 Check for the start marker in the input stream.
virtual bool checkStreamTrailer () throw ()
 Check for the end marker in the output stream.
virtual bool getObjectHeader (String &type_name, LongSize &ptr) throw ()
 Get an (unknown) object header.
virtual void writeName (const char *name) throw ()
 Write a variable/member name.
virtual bool checkName (const char *name) throw ()
 Check for variable/member name.
virtual void writeStorableHeader (const char *type_name, const char *name) throw ()
 Write storable object header.
virtual bool checkStorableHeader (const char *type_name, const char *name) throw ()
 Check for storable object header.
virtual void writePrimitiveHeader (const char *type_name, const char *name) throw ()
 Write type header and name for a primitive type.
virtual bool checkPrimitiveHeader (const char *type_name, const char *name) throw ()
 Check for a type header and name for a primitive type.
virtual void writeStorableTrailer () throw ()
 Write storable object trailer.
virtual bool checkStorableTrailer () throw ()
 Check for storable object trailer.
virtual void writePrimitiveTrailer () throw ()
 Write the trailer for a primitive type.
virtual bool checkPrimitiveTrailer () throw ()
 Check the trailer of a primitive type.
virtual void writeObjectPointerHeader (const char *type_name, const char *name) throw ()
 Write header for a pointer to a PersistentObject.
virtual bool checkObjectPointerHeader (const char *type_name, const char *name) throw ()
 Check for header for a pointer to a PersistentObject.
virtual void writeObjectReferenceHeader (const char *type_name, const char *name) throw ()
 Write header for a reference to a PersistentObject.
virtual bool checkObjectReferenceHeader (const char *type_name, const char *name) throw ()
 Check for header for a reference to a PersistentObject.
virtual void writeObjectPointerArrayHeader (const char *type_name, const char *name, Size size) throw ()
 Write header for an array of pointers to PersistentObjects.
virtual bool checkObjectPointerArrayHeader (const char *type_name, const char *name, Size &size) throw ()
 Check for header for an array of pointers to PersistentObjects.
virtual void writeObjectPointerArrayTrailer () throw ()
 Write trailer for an array of pointers to PersistentObjects.
virtual bool checkObjectPointerArrayTrailer () throw ()
 Check for trailer for an array of pointers to PersistentObjects.
virtual void initializeOutputStream () throw ()
 Prepare the stream for output.
virtual void finalizeOutputStream () throw ()
 Prepare the stream for closing.
virtual void initializeInputStream () throw ()
 Prepare the stream for output.
virtual void finalizeInputStream () throw ()
 Prepare the stream for closing.
Put methods for primitive data types.
virtual void put (const char c) throw ()
 Write a signed char to the output stream.
virtual void put (const Byte b) throw ()
 Write a single byte the output stream.
virtual void put (const Index i) throw ()
 Write an Index to the output stream.
virtual void put (const Size s) throw ()
 Write a Size or a Position to the output stream.
virtual void put (const bool b) throw ()
 Write a boolean value to the output stream.
virtual void put (const Real f) throw ()
 Write a single precision floating point number to the output stream.
virtual void put (const DoubleReal d) throw ()
 Write a double precision floating point number to the output stream.
virtual void put (const string &s) throw ()
 Write a string to the output.
virtual void put (const LongSize p) throw ()
 Write a pointer to the output.
Get methods for primitive data types.
virtual void get (char &c) throw ()
 Read a signed char from the input stream.
virtual void get (Byte &c) throw ()
 Read a single byte from the input stream.
virtual void get (Index &s) throw ()
 Read an Index from the input stream.
virtual void get (Size &s) throw ()
 Read a Size or a Position from the input stream.
virtual void get (bool &b) throw ()
 Read a boolean value from the input stream.
virtual void get (Real &f) throw ()
 Read a single precision floating point number from the input stream.
virtual void get (DoubleReal &d) throw ()
 Read a double precision floating point number from the input stream.
virtual void get (string &s) throw ()
 Read a string from the output stream.
virtual void get (LongSize &p) throw ()
 Read a pointer from the input stream.

Static Public Attributes

Constants
const Size STREAM_HEADER
 A constant value used to mark the beginning of a persistent stream.
const Size STREAM_TRAILER
 A constant value used to mark the end of a persistent stream.
const Size OBJECT_HEADER
 A constant value used to mark the beginning of an object.
const Size OBJECT_TRAILER
 A constant value used to mark the end of an object.

Detailed Description

XDR-format-based persistence manager.

This class implements a persistence manager that reads and writes its objects in a portable binary format.

See also:
TextPersistenceManager


Constructor & Destructor Documentation

XDRPersistenceManager::XDRPersistenceManager  )  throw ()
 

Default constructor.

XDRPersistenceManager::XDRPersistenceManager std::istream &  is,
std::ostream &  os
throw ()
 

Detailed constructor with an input stream and an output stream.


Member Function Documentation

virtual bool XDRPersistenceManager::checkHeader const char *  type_name,
const char *  name,
LongSize ptr
throw () [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 PersistenceManager.

virtual bool XDRPersistenceManager::checkName const char *  name  )  throw () [virtual]
 

Check for variable/member name.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkObjectPointerArrayHeader const char *  type_name,
const char *  name,
Size size
throw () [virtual]
 

Check for header for an array of pointers to PersistentObjects.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkObjectPointerArrayTrailer  )  throw () [virtual]
 

Check for trailer for an array of pointers to PersistentObjects.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkObjectPointerHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Check for header for a pointer to a PersistentObject.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkObjectReferenceHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Check for header for a reference to a PersistentObject.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkPrimitiveHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Check for a type header and name for a primitive type.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkPrimitiveTrailer  )  throw () [virtual]
 

Check the trailer of a primitive type.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkStorableHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Check for storable object header.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkStorableTrailer  )  throw () [virtual]
 

Check for storable object trailer.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkStreamHeader  )  throw () [virtual]
 

Check for the start marker in the input stream.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkStreamTrailer  )  throw () [virtual]
 

Check for the end marker in the output stream.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::checkTrailer const char *  name = 0  )  throw () [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 PersistenceManager.

virtual void XDRPersistenceManager::finalizeInputStream  )  throw () [virtual]
 

Prepare the stream for closing.

This method destroys the XDR output stream (using xdr_destroy).

Reimplemented from PersistenceManager.

virtual void XDRPersistenceManager::finalizeOutputStream  )  throw () [virtual]
 

Prepare the stream for closing.

This method destroys the XDR output stream (using xdr_destroy).

Reimplemented from PersistenceManager.

virtual void XDRPersistenceManager::get LongSize p  )  throw () [virtual]
 

Read a pointer from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get string &  s  )  throw () [virtual]
 

Read a string from the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get DoubleReal d  )  throw () [virtual]
 

Read a double precision floating point number from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get Real f  )  throw () [virtual]
 

Read a single precision floating point number from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get bool &  b  )  throw () [virtual]
 

Read a boolean value from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get Size s  )  throw () [virtual]
 

Read a Size or a Position from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get Index s  )  throw () [virtual]
 

Read an Index from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get Byte c  )  throw () [virtual]
 

Read a single byte from the input stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::get char &  c  )  throw () [virtual]
 

Read a signed char from the input stream.

Implements PersistenceManager.

virtual bool XDRPersistenceManager::getObjectHeader String type_name,
LongSize ptr
throw () [virtual]
 

Get an (unknown) object header.

Implements PersistenceManager.

virtual void XDRPersistenceManager::initializeInputStream  )  throw () [virtual]
 

Prepare the stream for output.

This method creates an XDR output stream (using xdrrec_create) and prepares it for output.

Reimplemented from PersistenceManager.

virtual void XDRPersistenceManager::initializeOutputStream  )  throw () [virtual]
 

Prepare the stream for output.

This method creates an XDR output stream (using xdrrec_create) and prepares it for output.

Reimplemented from PersistenceManager.

virtual void XDRPersistenceManager::put const LongSize  p  )  throw () [virtual]
 

Write a pointer to the output.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const string &  s  )  throw () [virtual]
 

Write a string to the output.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const DoubleReal  d  )  throw () [virtual]
 

Write a double precision floating point number to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const Real  f  )  throw () [virtual]
 

Write a single precision floating point number to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const bool  b  )  throw () [virtual]
 

Write a boolean value to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const Size  s  )  throw () [virtual]
 

Write a Size or a Position to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const Index  i  )  throw () [virtual]
 

Write an Index to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const Byte  b  )  throw () [virtual]
 

Write a single byte the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::put const char  c  )  throw () [virtual]
 

Write a signed char to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeHeader const char *  type_name,
const char *  name,
LongSize  ptr
throw () [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 PersistenceManager.

virtual void XDRPersistenceManager::writeName const char *  name  )  throw () [virtual]
 

Write a variable/member name.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeObjectPointerArrayHeader const char *  type_name,
const char *  name,
Size  size
throw () [virtual]
 

Write header for an array of pointers to PersistentObjects.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeObjectPointerArrayTrailer  )  throw () [virtual]
 

Write trailer for an array of pointers to PersistentObjects.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeObjectPointerHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Write header for a pointer to a PersistentObject.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeObjectReferenceHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Write header for a reference to a PersistentObject.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writePrimitiveHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Write type header and name for a primitive type.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writePrimitiveTrailer  )  throw () [virtual]
 

Write the trailer for a primitive type.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeStorableHeader const char *  type_name,
const char *  name
throw () [virtual]
 

Write storable object header.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeStorableTrailer  )  throw () [virtual]
 

Write storable object trailer.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeStreamHeader  )  throw () [virtual]
 

Write a start marker to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeStreamTrailer  )  throw () [virtual]
 

Write an end marker to the output stream.

Implements PersistenceManager.

virtual void XDRPersistenceManager::writeTrailer const char *  name = 0  )  throw () [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 PersistenceManager.