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

PersistenceManager Class Reference
[Object Persistence.]

Persistence manager class. More...

#include <persistenceManager.h>

Inheritance diagram for PersistenceManager:

TextPersistenceManager XDRPersistenceManager List of all members.

Public Types

Type Definitions
typedef void *(* CreateMethod )()
 Create method type.

Public Member Functions

Constructors and Destructors
 PersistenceManager () throw ()
 Default constructor.
 PersistenceManager (const PersistenceManager &pm) throw ()
 Copy constructor.
 PersistenceManager (::std::istream &is) throw ()
 Detailed constructor with an input stream.
 PersistenceManager (::std::ostream &os) throw ()
 Detailed constructor with an output stream.
 PersistenceManager (::std::istream &is,::std::ostream &os) throw ()
 Detailed constructor with an input stream and an output stream.
virtual ~PersistenceManager () throw ()
 Destructor.
Layer 2 commands
virtual void registerClass (String signature, const CreateMethod m) throw ()
 Register a create method for a class.
virtual void * createObject (String signature) const throw ()
 Create an object of a registered class.
virtual Size getNumberOfClasses () const throw ()
 Return the number of registerd classes.
virtual void setOstream (::std::ostream &s) throw ()
 Set the output stream for persistent objects.
virtual void setIstream (::std::istream &s) throw ()
 Set the input stream for persistent objects.
void startOutput () throw ()
 Start the output to a persistent stream.
void endOutput () throw ()
 Terminate the output to a persistent stream.
PersistentObjectreadObject () throw (Exception::GeneralException)
 Read a persistent object from the stream.
PersistenceManageroperator<< (const PersistentObject &object) throw ()
 Write a persistent object to the stream.
PersistenceManageroperator>> (PersistentObject *&object_ptr) throw ()
 Read a persistent object from a stream.
Layer 1 methods
template<typename T>
bool checkObjectHeader (const T &, const char *name=0) throw ()
 Check an object header by determining its stream name by using.
bool checkObjectHeader (const char *type_name) throw ()
 Check an object header by supplying its stream name.
template<typename T>
void writeObjectHeader (const T *object, const char *name=0) throw ()
 Write an object Header.
void writeObjectTrailer (const char *name=0) throw ()
 Write an object trailer by calling.
bool checkObjectTrailer (const char *name=0) throw ()
 Check an object trailer by calling.
template<typename T>
void writePrimitive (const T &t, const char *name) throw ()
 Write a primitive member variable.
template<typename T>
bool readPrimitive (T &t, const char *name) throw ()
 Read a primitive member variable.
template<typename T>
void writeStorableObject (const T &t, const char *name) throw ()
 Write a storable object.
template<typename T>
bool readStorableObject (T &t, const char *name) throw ()
 Read a storable object.
template<typename T>
void writeObjectPointer (const T *object, const char *name) throw ()
 Write a pointer to a PersistentObject.
template<typename T>
bool readObjectPointer (T *&object, const char *name) throw ()
 Read a pointer to a PersistentObject.
template<typename T>
void writeObjectReference (const T &object, const char *name) throw ()
 Write a reference to a PersistentObject.
template<typename T>
bool readObjectReference (T &object, const char *name) throw ()
 Read a reference to a PersistentObject.
template<typename T>
void writeObjectArray (const T *array, const char *name, Size size) throw ()
 Write an array of persistent objects.
template<typename T>
bool readObjectArray (const T *array, const char *name, Size &size) throw ()
 Read an array of persistent objects.
template<typename T>
void writeObjectPointerArray (T **arr, const char *name, const Size size) throw ()
 Write an array of pointers to persistent objects.
template<typename T>
bool readObjectPointerArray (T **array, const char *name, Size &size) throw ()
 Read an array of persistent object pointers.
Layer 0 methods
virtual void writeHeader (const char *type_name, const char *name, LongSize ptr)=0
 Write the header for an object.
virtual bool checkHeader (const char *type_name, const char *name, LongSize &ptr)=0
 Check an object header.
virtual void writeTrailer (const char *name=0)=0
 Write the trailer for an object.
virtual bool checkTrailer (const char *name=0)=0
 Check an object trailer.
virtual void writeStreamHeader ()=0
 Write a start marker to the output stream.
virtual void writeStreamTrailer ()=0
 Write an end marker to the output stream.
virtual bool checkStreamHeader ()=0
 Check for the start marker in the input stream.
virtual bool checkStreamTrailer ()=0
 Check for the end marker in the output stream.
virtual bool getObjectHeader (String &type_name, LongSize &ptr)=0
 Get an (unknown) object header.
virtual void writeName (const char *name)=0
 Write a variable/member name.
virtual bool checkName (const char *name)=0
 Check for variable/member name.
virtual void writeStorableHeader (const char *type_name, const char *name)=0
 Write storable object header.
virtual bool checkStorableHeader (const char *type_name, const char *name)=0
 Check for storable object header.
virtual void writeStorableTrailer ()=0
 Write the trailer for a storable object.
virtual bool checkStorableTrailer ()=0
 Check for the trailer of a storable object.
virtual void writePrimitiveHeader (const char *type_name, const char *name)=0
 Write type header and name for a primitive type.
virtual bool checkPrimitiveHeader (const char *type_name, const char *name)=0
 Check for a type header and name for a primitive type.
virtual void writePrimitiveTrailer ()=0
 Write the trailer for a primitive type.
virtual bool checkPrimitiveTrailer ()=0
 Check for the trailer of a primitive type.
virtual void writeObjectPointerHeader (const char *type_name, const char *name)=0
 Write header for a pointer to a PersistentObject.
virtual bool checkObjectPointerHeader (const char *type_name, const char *name)=0
 Check for header for a pointer to a PersistentObject.
virtual void writeObjectReferenceHeader (const char *type_name, const char *name)=0
 Write header for a reference to a PersistentObject.
virtual bool checkObjectReferenceHeader (const char *type_name, const char *name)=0
 Check for header for a reference to a PersistentObject.
virtual void writeObjectPointerArrayHeader (const char *type_name, const char *name, Size size)=0
 Write header for an array of pointers to PersistentObjects.
virtual bool checkObjectPointerArrayHeader (const char *type_name, const char *name, Size &size)=0
 Check for header for an array of pointers to PersistentObjects.
virtual void writeObjectPointerArrayTrailer ()=0
 Write trailer for an array of pointers to PersistentObjects.
virtual bool checkObjectPointerArrayTrailer ()=0
 Check for trailer for an array of pointers to PersistentObjects.
virtual void initializeOutputStream () throw ()
 Prepare the output stream for output.
virtual void finalizeOutputStream () throw ()
 Prepare the output stream for closing.
virtual void initializeInputStream () throw ()
 Prepare the input stream for reading.
virtual void finalizeInputStream () throw ()
 Prepare the input stream for closing.
Put methods for primitive data types.
Persistence in BALL supports the following predefined data types: {tabular}{lcc} Name & signed/unsigned & Size (in bit)

char & signed & 8
bool & - & 1
Byte & unsigned & 8
Index & signed & 32
Size/Position & unsigned & 32
LongSize & unsigned & 64
float & signed & 32
double & signed & 64
long double & signed & 128
String & - & - {tabular}


virtual void put (const char c)=0
 Write a signed char to the output stream.
virtual void put (const Byte c)=0
 Write a single byte to the output stream.
virtual void put (const Index i)=0
 Write an Index to the output stream.
virtual void put (const Size p)=0
 Write a Position or a Size to the output stream.
virtual void put (const bool b)=0
 Write a boolean value to the output stream.
virtual void put (const Real f)=0
 Write a single precision floating point number to the output stream.
virtual void put (const DoubleReal d)=0
 Write a double precision floating point number to the output stream.
virtual void put (const string &s)=0
 Write a string to the output.
virtual void put (const LongSize p)=0
 Write a pointer to the output.
Get methods for primitive data types.
virtual void get (char &c)=0
 Read a signed char from the input stream.
virtual void get (Byte &b)=0
 Read a single Byte from the input stream.
virtual void get (Index &s)=0
 Read an Index from the input stream.
virtual void get (Size &s)=0
 Read a Size or a Position from the input stream.
virtual void get (bool &b)=0
 Read a boolean value from the input stream.
virtual void get (Real &f)=0
 Read a single precision floating point number from the input stream.
virtual void get (DoubleReal &d)=0
 Read a double precision floating point number from the input stream.
virtual void get (string &s)=0
 Read a string from the output stream.
virtual void get (LongSize &p)=0
 Read a 64-bit pointer from the input stream.

Protected Types

typedef HashSet< const PersistentObject * > ObjectSet
typedef std::list< const PersistentObject * > ObjectList
typedef HashMap< LongSize,
void * > 
PointerMap
typedef std::list< std::pair<
void **, LongSize > > 
PointerList

Protected Member Functions

void registerKernelClasses_ () throw ()
void addPointerPair_ (LongSize old_ptr, void *new_ptr) throw ()
void addNeededObjects_ () throw (Exception::GeneralException)
bool updatePointers_ () throw ()

Protected Attributes

StringHashMap< CreateMethodcreate_methods_
ObjectSet object_out_
ObjectList object_out_needed_
PointerMap pointer_map_
PointerList pointer_list_
ObjectList object_in_
::std::ostream * ostr_
::std::istream * istr_

Detailed Description

Persistence manager class.

This class serializes and deserializes persistent objects and provides support for the implementation of the object-specific serialization methods persistentRead and persistentWrite . It defines three different layers:


Member Typedef Documentation

typedef void*(* PersistenceManager::CreateMethod)()
 

Create method type.

This type describes a method to dynamically create a specific object. It should return a void pointer for interface compatibility and doesn't take an argument. It creates a new object and returns the object's this pointer (cast to void*). The getNew function (in the RTTI namespace) is an example for such a method.

See also:
registerClass

RTTI

CREATE


Constructor & Destructor Documentation

PersistenceManager::PersistenceManager ::std::istream &  is  )  throw ()
 

Detailed constructor with an input stream.

Creates a persistence manager object and assigns an input stream.

PersistenceManager::PersistenceManager ::std::ostream &  os  )  throw ()
 

Detailed constructor with an output stream.

Creates a persistence manager object and assigns an output stream.

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

Detailed constructor with an input stream and an output stream.

Creates a persistence manager object and assigns an input stream and an output stream.

virtual PersistenceManager::~PersistenceManager  )  throw () [virtual]
 

Destructor.

Destruct the persistence manager and and clear up all data structures. The associated streams or sockets ( setIStream / setOStream ) are not closed.


Member Function Documentation

virtual bool PersistenceManager::checkHeader const char *  type_name,
const char *  name,
LongSize ptr
[pure virtual]
 

Check an object header.

Parameters:
type_name the stream name of the class to be read
name the expected name of the object
ptr a reference to a PointerSizeUInt to store the this pointer of the object read from the stream
Returns:
bool true, if the header was correct, false otherwise

ptr the pointer is set to the value read from the file

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkName const char *  name  )  [pure virtual]
 

Check for variable/member name.

Parameters:
name the name we want to check
Returns:
true if the name matches

Implemented in TextPersistenceManager, and XDRPersistenceManager.

bool PersistenceManager::checkObjectHeader const char *  type_name  )  throw ()
 

Check an object header by supplying its stream name.

Parameters:
type_name the stream name of the object type
Returns:
true if the object header could be checked successfully

template<typename T>
bool PersistenceManager::checkObjectHeader const T &  ,
const char *  name = 0
throw ()
 

Check an object header by determining its stream name by using.

See also:
RTTI and calling

checkHeader.

Parameters:
object an Object of type T
name the expected name of the object
Returns:
true if the object header could be checked successfully

virtual bool PersistenceManager::checkObjectPointerArrayHeader const char *  type_name,
const char *  name,
Size size
[pure virtual]
 

Check for header for an array of pointers to PersistentObjects.

Parameters:
type_name the stream name of the object type
name the name of the object array (?)
size the size of the array
Returns:
true if the header was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkObjectPointerArrayTrailer  )  [pure virtual]
 

Check for trailer for an array of pointers to PersistentObjects.

Returns:
true if the trailer was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkObjectPointerHeader const char *  type_name,
const char *  name
[pure virtual]
 

Check for header for a pointer to a PersistentObject.

Parameters:
type_name the stream name of the object type
name the name of the object
Returns:
true if the header was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkObjectReferenceHeader const char *  type_name,
const char *  name
[pure virtual]
 

Check for header for a reference to a PersistentObject.

Parameters:
type_name the stream name of the object type
name the name of the object
Returns:
true if the header was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

bool PersistenceManager::checkObjectTrailer const char *  name = 0  )  throw ()
 

Check an object trailer by calling.

See also:
checkTrailer.
Parameters:
name the name of the object

virtual bool PersistenceManager::checkPrimitiveHeader const char *  type_name,
const char *  name
[pure virtual]
 

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

Parameters:
type_name the stream name of the primitive
name the name of the primitive
Returns:
true if type and name of the primitive match

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkPrimitiveTrailer  )  [pure virtual]
 

Check for the trailer of a primitive type.

Returns:
true if the trailer was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkStorableHeader const char *  type_name,
const char *  name
[pure virtual]
 

Check for storable object header.

Parameters:
type_name the stream name of the storable object
name the name of the object

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkStorableTrailer  )  [pure virtual]
 

Check for the trailer of a storable object.

Returns:
true if the trailer was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkStreamHeader  )  [pure virtual]
 

Check for the start marker in the input stream.

Returns:
true if the marker could be checked.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkStreamTrailer  )  [pure virtual]
 

Check for the end marker in the output stream.

Returns:
true if the marker could be checked.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual bool PersistenceManager::checkTrailer const char *  name = 0  )  [pure virtual]
 

Check an object trailer.

This method checks the trailer of an object.

Parameters:
name the name of the object
Returns:
true if the trailer was correct

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void* PersistenceManager::createObject String  signature  )  const throw () [virtual]
 

Create an object of a registered class.

If the persistence manager has registered a create method for the given class signature, the corresponding create method is called and its result is returned. If the class is not registered, 0 is returned.

Parameters:
signature the class signature of the object to be created
Returns:
void* a pointer to the new object or 0, if the signature is not known
See also:
registerClass

void PersistenceManager::endOutput  )  throw ()
 

Terminate the output to a persistent stream.

This method finishes the writing of a persistent object to a stream. In fact, it does most of the work. It checks for the list of "missing" objects, i.e. objects that have been referenced via a pointer or a reference by the objects written before and calls their persistent write methods. It then writes an end marker to the file (via writeStreamTrailer) and clears the pending output list.

It need not be called usually, as it is called by operator >>.

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

Prepare the input stream for closing.

Reimplemented in XDRPersistenceManager.

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

Prepare the output stream for closing.

Reimplemented in XDRPersistenceManager.

virtual void PersistenceManager::get LongSize p  )  [pure virtual]
 

Read a 64-bit pointer from the input stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get string &  s  )  [pure virtual]
 

Read a string from the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get DoubleReal d  )  [pure virtual]
 

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

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get Real f  )  [pure virtual]
 

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

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get bool &  b  )  [pure virtual]
 

Read a boolean value from the input stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get Size s  )  [pure virtual]
 

Read a Size or a Position from the input stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get Index s  )  [pure virtual]
 

Read an Index from the input stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get Byte b  )  [pure virtual]
 

Read a single Byte from the input stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::get char &  c  )  [pure virtual]
 

Read a signed char from the input stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual Size PersistenceManager::getNumberOfClasses  )  const throw () [virtual]
 

Return the number of registerd classes.

Returns:
Size the nubmer of classes contained in the persistence manager's internal StringHashMap

virtual bool PersistenceManager::getObjectHeader String type_name,
LongSize ptr
[pure virtual]
 

Get an (unknown) object header.

The name (if set) is ignored. The type name is returned in type_name and the address of the object is read but not inserted into the table.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

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

Prepare the input stream for reading.

Reimplemented in XDRPersistenceManager.

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

Prepare the output stream for output.

Reimplemented in XDRPersistenceManager.

PersistenceManager& PersistenceManager::operator<< const PersistentObject object  )  throw ()
 

Write a persistent object to the stream.

This method writes a persistent object to a stream.

PersistenceManager& PersistenceManager::operator>> PersistentObject *&  object_ptr  )  throw ()
 

Read a persistent object from a stream.

This method calls readObject .

virtual void PersistenceManager::put const LongSize  p  )  [pure virtual]
 

Write a pointer to the output.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const string &  s  )  [pure virtual]
 

Write a string to the output.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const DoubleReal  d  )  [pure virtual]
 

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

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const Real  f  )  [pure virtual]
 

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

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const bool  b  )  [pure virtual]
 

Write a boolean value to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const Size  p  )  [pure virtual]
 

Write a Position or a Size to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const Index  i  )  [pure virtual]
 

Write an Index to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const Byte  c  )  [pure virtual]
 

Write a single byte to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::put const char  c  )  [pure virtual]
 

Write a signed char to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

PersistentObject* PersistenceManager::readObject  )  throw (Exception::GeneralException)
 

Read a persistent object from the stream.

This method tries to read a persistent object from the stream, creates the object and all dependend objects, finally demangles all pointers and references.

If no object could be read or the format was not correct, a null pointer is returned.
Returns:
0 if no object could be read, the object's this pointer otherwise

template<typename T>
bool PersistenceManager::readObjectArray const T *  array,
const char *  name,
Size size
throw ()
 

Read an array of persistent objects.

This method reads size persistent objects from the persistent stream. It also checks header and trailer of the array.

Parameters:
array the array of persistent objects
name the name (usually the name of the member variable)
size the number of elements in the array

template<typename T>
bool PersistenceManager::readObjectPointer T *&  object,
const char *  name
throw ()
 

Read a pointer to a PersistentObject.

This method also checks header and trailer.

Parameters:
object a mutable pointer reference wa want to read.
name the name of the object pointer (usually the name of the member variable)
Returns:
true if reading wass successful

template<typename T>
bool PersistenceManager::readObjectPointerArray T **  array,
const char *  name,
Size size
throw ()
 

Read an array of persistent object pointers.

This method reads size persistent object pointers from the persistent stream. It also checks header and trailer of the array.

Parameters:
array the array of persistent object pointers
name the name (usually the name of the member variable)
size the number of elements in the array

template<typename T>
bool PersistenceManager::readObjectReference T &  object,
const char *  name
throw ()
 

Read a reference to a PersistentObject.

This method also checks header and trailer of the object reference.

Parameters:
object a mutable reference
name the name of the object (usually the name of the member variable)
Returns:
true if reading was successful

template<typename T>
bool PersistenceManager::readPrimitive T &  t,
const char *  name
throw ()
 

Read a primitive member variable.

This method also checks header and trailer of the primitive.

Parameters:
t a mutable reference of the primitive variable
name the expected name of the variable
Returns:
true if readng was successful

template<typename T>
bool PersistenceManager::readStorableObject T &  t,
const char *  name
throw ()
 

Read a storable object.

This method also checks header and trailer of the object.

Parameters:
t a mutable reference of the object
name the expected name of the object
Returns:
true if reading the object was successful.

virtual void PersistenceManager::registerClass String  signature,
const CreateMethod  m
throw () [virtual]
 

Register a create method for a class.

Each object read by the persistence manager has to be constructed somehow. The persistence manager first reads a class' signature (i.e. a unique identifier in the context of this stream). This is usually the stream name of the class (see getStreamName ), but can be an arbitrary string (without blanks). When reading an object header with a given class signature, the persistence manager tries to find a method to create an instance of this object. For this purpose it contains a StringHashMap object. Each of the classes to be read has to be contained in this hash map together with a method to create an instance of this object. This is done by calling registerClass. The create method is usually the getNew method for a class:

  PersistenceManager pm;
  pm.registerClass(RTTI::getStreamName<Atom>(), RTTI::getNew<Atom>);
  pm.registerClass(RTTI::getStreamName<Composite>(), RTTI::getNew<Composite>);
Remember to include the baseclasses of each class, too! To register all kernel classes, use the BALL_REGISTER_PERSISTENT_KERNEL_CLASSES macro.
Parameters:
signature the class signatur
m a dynamic class create method

virtual void PersistenceManager::setIstream ::std::istream &  s  )  throw () [virtual]
 

Set the input stream for persistent objects.

Parameters:
s the input stream

virtual void PersistenceManager::setOstream ::std::ostream &  s  )  throw () [virtual]
 

Set the output stream for persistent objects.

Parameters:
s the output stream

void PersistenceManager::startOutput  )  throw ()
 

Start the output to a persistent stream.

This method write a start marker to the output stream and prepares the stream and the persistence manager's internal data structures for the output of an object. The start marker is written via the method writeStreamHeader .

It need not be called usually, as it is called by operator >>.

virtual void PersistenceManager::writeHeader const char *  type_name,
const char *  name,
LongSize  ptr
[pure virtual]
 

Write the header for an object.

This method writes the header information containing the class signature, the name and its this pointer. The name information is required to differentiate between base classes of an object and member objects or the object itself. If writeHeader is called for a base class, name should be set to 0. type_name should refer to the stream name of an object (see getStreamName ).

When defining an object (i.e. when writing the first header to a persistent stream), name should be set to "". For base classes, name has to be set to 0. The exact behaviour of this method is implementation dependend - it is abstract for PersistenceManager.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeName const char *  name  )  [pure virtual]
 

Write a variable/member name.

Parameters:
name the name we want to write

Implemented in TextPersistenceManager, and XDRPersistenceManager.

template<typename T>
void PersistenceManager::writeObjectArray const T *  array,
const char *  name,
Size  size
throw ()
 

Write an array of persistent objects.

This method writes size persistent objects to the persistent stream. It also writes the necessary header and trailer.

Parameters:
array the array of persistent objects
name the name (usually the name of the member variable)
size the number of elements in the array

template<typename T>
void PersistenceManager::writeObjectHeader const T *  object,
const char *  name = 0
throw ()
 

Write an object Header.

Determine the stream name of the object via

See also:
RTTI and call

writeHeader.

Parameters:
object a const pointer to the object
name the name of the object

template<typename T>
void PersistenceManager::writeObjectPointer const T *  object,
const char *  name
throw ()
 

Write a pointer to a PersistentObject.

This method also writes the necessary header and trailer.

Parameters:
object a const pointer to the object we want to write
name the name of the object pointer (the name of the member variable written)

template<typename T>
void PersistenceManager::writeObjectPointerArray T **  arr,
const char *  name,
const Size  size
throw ()
 

Write an array of pointers to persistent objects.

This method writes size persistent objects to the persistent stream. It also writes the necessary header and trailer.

Parameters:
arr the array of persistent object pointers
name the name (usually the name of the member variable)
size the number of elements in the array

virtual void PersistenceManager::writeObjectPointerArrayHeader const char *  type_name,
const char *  name,
Size  size
[pure virtual]
 

Write header for an array of pointers to PersistentObjects.

Parameters:
type_name the stream name of the object type
name the name of the object array (?)
size the size of the array

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeObjectPointerArrayTrailer  )  [pure virtual]
 

Write trailer for an array of pointers to PersistentObjects.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeObjectPointerHeader const char *  type_name,
const char *  name
[pure virtual]
 

Write header for a pointer to a PersistentObject.

Parameters:
type_name the stream name of the object type
name the name of the object

Implemented in TextPersistenceManager, and XDRPersistenceManager.

template<typename T>
void PersistenceManager::writeObjectReference const T &  object,
const char *  name
throw ()
 

Write a reference to a PersistentObject.

This method also writes the necessary header and trailer.

Parameters:
object a const reference to the object
name the name of the object (usually the name of the member variable)

virtual void PersistenceManager::writeObjectReferenceHeader const char *  type_name,
const char *  name
[pure virtual]
 

Write header for a reference to a PersistentObject.

Parameters:
type_name the stream name of the object type
name the name of the object

Implemented in TextPersistenceManager, and XDRPersistenceManager.

void PersistenceManager::writeObjectTrailer const char *  name = 0  )  throw ()
 

Write an object trailer by calling.

See also:
writeTrailer.
Parameters:
name the name of the object

template<typename T>
void PersistenceManager::writePrimitive const T &  t,
const char *  name
throw ()
 

Write a primitive member variable.

This method also writes the necessary header and trailer of the primitive.

Parameters:
t the variable
name the name of the variable

virtual void PersistenceManager::writePrimitiveHeader const char *  type_name,
const char *  name
[pure virtual]
 

Write type header and name for a primitive type.

Parameters:
type_name the stream name of the primitive
name the name of the primitive

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writePrimitiveTrailer  )  [pure virtual]
 

Write the trailer for a primitive type.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeStorableHeader const char *  type_name,
const char *  name
[pure virtual]
 

Write storable object header.

Parameters:
type_name the stream name of the storable object
name the name of the object

Implemented in TextPersistenceManager, and XDRPersistenceManager.

template<typename T>
void PersistenceManager::writeStorableObject const T &  t,
const char *  name
throw ()
 

Write a storable object.

This method also writes header and trailer of the object.

Parameters:
t the storable object
name the name of the object

virtual void PersistenceManager::writeStorableTrailer  )  [pure virtual]
 

Write the trailer for a storable object.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeStreamHeader  )  [pure virtual]
 

Write a start marker to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeStreamTrailer  )  [pure virtual]
 

Write an end marker to the output stream.

Implemented in TextPersistenceManager, and XDRPersistenceManager.

virtual void PersistenceManager::writeTrailer const char *  name = 0  )  [pure virtual]
 

Write the trailer for an object.

Parameters:
name the name of the object

Implemented in TextPersistenceManager, and XDRPersistenceManager.