DAOInterface Class Reference

Concrete interface class passed into the user serialize methods. More...

#include <CkptDAO.h>

List of all members.

Public Member Functions

 DAOInterface (CommonDAO *daoImpl)
virtual ~DAOInterface ()
virtual DAOMode getMode ()
template<class RawObj>
DAOInterfacebyteCopy (RawObj *obj, unsigned int dataSize)
 Performs a raw byte copy.
DAOInterfaceoperator & (DAOSerializable &t)
 Primary method used for object serialization.
byte_arraygetOutputData ()
template<class ExtClass>
void invokeExternalSerializer (ExtClass &extObj, void(*eS)(DAOInterface &, ExtClass &))
 Invokes the serialization code for a class that doesn't implement DAOSerializable.
template<class Serializable>
DAOInterfaceoperator & (Serializable *&t)
 Process a pointer reference.

Private Attributes

CommonDAOimpl


Detailed Description

Concrete interface class passed into the user serialize methods.

The delegator of the DAO layer. Responsible for invoking serialize methods for objects in the serialization path until basic primitives or byte copies are reached. Invokes the processPrim routines in the DAO that it represents to perform the actual I/O.

Created via a DAOInterfaceFactory

Definition at line 97 of file CkptDAO.h.


Constructor & Destructor Documentation

DAOInterface::DAOInterface ( CommonDAO daoImpl  )  [inline]

Definition at line 99 of file CkptDAO.h.

virtual DAOInterface::~DAOInterface (  )  [inline, virtual]

Definition at line 100 of file CkptDAO.h.


Member Function Documentation

virtual DAOMode DAOInterface::getMode (  )  [inline, virtual]

Definition at line 101 of file CkptDAO.h.

template<class RawObj>
DAOInterface& DAOInterface::byteCopy ( RawObj *  obj,
unsigned int  dataSize 
) [inline]

Performs a raw byte copy.

WARNING: This does not allocate the storage space for the object during deserialization. The RawObj pointer must point to valid memory of the appropriate size.

Handles a raw byte copy with the DAO for structs/objects that do not implement DAOSerializable and are have no associated serialization function that could be passed to invokeExternalSerializer().

Use of this function is strongly discouraged. invokeExternalSerializer() is the recommended method for serializing structures that do not participate in the DAOSerializable hierarchy.

Definition at line 137 of file CkptDAO.h.

DAOInterface& DAOInterface::operator & ( DAOSerializable t  )  [inline]

Primary method used for object serialization.

This is the operator invoked by the DAOSerializable object from its DAOSerializable::serialize() method when it's parsing an embedded serializable object. Eg. Class A and B implement DAOSerializable. Class A contains an instance (b) of class B. A::serialize(DAOInterface &dao) invokes this routine via:

dao & b

Definition at line 154 of file CkptDAO.h.

References DAOSerializable::serialize().

byte_array* DAOInterface::getOutputData (  )  [inline]

Definition at line 159 of file CkptDAO.h.

References DAO_OUTPUT, and CommonDAO::getMode().

Referenced by CkptContainer::commit(), and CkptContainer::persist().

template<class ExtClass>
void DAOInterface::invokeExternalSerializer ( ExtClass &  extObj,
void(*)(DAOInterface &, ExtClass &)  eS 
) [inline]

Invokes the serialization code for a class that doesn't implement DAOSerializable.

Permits the serialization of objects and structures that can't participate in the DAOSerializable heirarchy (a structure in a library for example). This can be bypassed by wrappering the struct, but this is a lighterweight mechanism.

Routes a serialization path through a user defined function rather than the serialize method of a class. The function should be defined with the prototype: void functionName(DAOInterface &, <ExternalObjectType> & ) where <ExternalObjectType> is the type of the class to be serialized. eg. struct Alpha { int x; } void alphaSerializer(DAOInterface &dao, Alpha &a) { dao & a.x; } In some other code, where an Alpha needs to be serialized: Alpha a; a.x = 42; dao.invokeExternalSerializer(alpha, alphaSerializer);

Parameters:
extObj - object to be serialized by the DAO
eS - serialization routine external to the class of extObj

Definition at line 187 of file CkptDAO.h.

template<class Serializable>
DAOInterface& DAOInterface::operator & ( Serializable *&  t  )  [inline]

Process a pointer reference.

We can only process pointers to objects that implement the DAOSerializable interface, have a default constructor and have registered via the TypeRegistry.

Definition at line 198 of file CkptDAO.h.

References DAOSerializable::serialize().


Member Data Documentation

CommonDAO* DAOInterface::impl [private]

Definition at line 202 of file CkptDAO.h.


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 17:20:02 2007 for aiscoal by  doxygen 1.5.2