MultiTypeDurableTable< _BaseType, _Collection > Class Template Reference

#include <DurableTable.h>

Inheritance diagram for MultiTypeDurableTable< _BaseType, _Collection >:

DurableTable< _BaseType >

List of all members.


Detailed Description

template<typename _BaseType, typename _Collection>
class MultiTypeDurableTable< _BaseType, _Collection >

Class for a durable table that can store various objects, each a subclass of _BaseType which must in turn be or be a subclass of TypedSerializableObject, and that has a type code defined in the template parameter _Collection.

Definition at line 150 of file DurableTable.h.


Public Member Functions

 MultiTypeDurableTable (DurableTableImpl *impl, const std::string &name, DurableObjectCache< _BaseType > *cache)
 Constructor.
int put (const SerializableObject &key, TypeCollection::TypeCode_t type, const _BaseType *data, int flags)
 Update the value of the key, data pair in the database.
int get (const SerializableObject &key, _BaseType **data, bool *from_cache=0)
 Get the data for key, possibly creating a new object of the given template type _Type (or some derivative), using the multitype collection specified by _Collection.

Static Public Member Functions

static int new_object (TypeCollection::TypeCode_t typecode, SerializableObject **generic_object)
 Object allocation callback that is handed to the implementation to allow it to properly create an object once it extracts the type code.

Private Member Functions

 MultiTypeDurableTable (const MultiTypeDurableTable &)

Constructor & Destructor Documentation

template<typename _BaseType, typename _Collection>
MultiTypeDurableTable< _BaseType, _Collection >::MultiTypeDurableTable ( DurableTableImpl impl,
const std::string &  name,
DurableObjectCache< _BaseType > *  cache 
) [inline]

Constructor.

Definition at line 155 of file DurableTable.h.

template<typename _BaseType, typename _Collection>
MultiTypeDurableTable< _BaseType, _Collection >::MultiTypeDurableTable ( const MultiTypeDurableTable< _BaseType, _Collection > &   )  [private]


Member Function Documentation

template<typename _BaseType, typename _Collection>
int MultiTypeDurableTable< _BaseType, _Collection >::put ( const SerializableObject &  key,
TypeCollection::TypeCode_t  type,
const _BaseType *  data,
int  flags 
)

Update the value of the key, data pair in the database.

It should already exist.

Parameters:
key Key object
type Type code for the object
data Data object
flags Bit vector of DurableStoreFlags_t values.
Returns:
DS_OK, DS_NOTFOUND, DS_ERR

template<typename _BaseType, typename _Collection>
int MultiTypeDurableTable< _BaseType, _Collection >::get ( const SerializableObject &  key,
_BaseType **  data,
bool from_cache = 0 
)

Get the data for key, possibly creating a new object of the given template type _Type (or some derivative), using the multitype collection specified by _Collection.

_Type therefore must be a valid superclass for the object identified by the type code in the database.

Parameters:
key Key object
data Data object
from_cache == true if the object retrieved from the cache
Returns:
DS_OK, DS_NOTFOUND if key is not found

template<typename _BaseType, typename _Collection>
static int MultiTypeDurableTable< _BaseType, _Collection >::new_object ( TypeCollection::TypeCode_t  typecode,
SerializableObject **  generic_object 
) [static]

Object allocation callback that is handed to the implementation to allow it to properly create an object once it extracts the type code.


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 08:36:21 2007 for DTN Reference Implementation by  doxygen 1.5.3