Barry::RecordBuilder< RecordT, StorageT > Class Template Reference

#include <builder.h>

Inheritance diagram for Barry::RecordBuilder< RecordT, StorageT >:

Barry::Builder List of all members.

Detailed Description

template<class RecordT, class StorageT>
class Barry::RecordBuilder< RecordT, StorageT >

Template class for easy creation of specific protocol packet builder objects.

This template takes the following template arguments:

Example SaveDatabase() call:

    FIXME
    

Definition at line 87 of file builder.h.

Public Member Functions

 RecordBuilder (StorageT &storage)
 Constructor that references an externally managed storage object.
 RecordBuilder (StorageT *storage)
 Constructor that references a locally managed storage object.
 ~RecordBuilder ()
virtual bool Retrieve (unsigned int databaseId)
 Called first in the sequence, to allow the application to load the needed data from memory, disk, etc.
virtual uint8_t GetRecType () const
 Called to retrive the unique ID for this record.
virtual uint32_t GetUniqueId () const
virtual void BuildHeader (Data &data, size_t &offset)
 Functor member called by Controller::SaveDatabase() during processing.
virtual void BuildFields (Data &data, size_t &offset)
 Called to build the record field data.


Constructor & Destructor Documentation

template<class RecordT, class StorageT>
Barry::RecordBuilder< RecordT, StorageT >::RecordBuilder ( StorageT &  storage  )  [inline]

Constructor that references an externally managed storage object.

Definition at line 95 of file builder.h.

template<class RecordT, class StorageT>
Barry::RecordBuilder< RecordT, StorageT >::RecordBuilder ( StorageT *  storage  )  [inline]

Constructor that references a locally managed storage object.

The pointer passed in will be stored, and freed when this class is destroyed. It is safe to call this constructor with a 'new'ly created storage object.

Definition at line 102 of file builder.h.


Member Function Documentation

template<class RecordT, class StorageT>
virtual bool Barry::RecordBuilder< RecordT, StorageT >::Retrieve ( unsigned int  databaseId  )  [inline, virtual]

Called first in the sequence, to allow the application to load the needed data from memory, disk, etc.

If successful, return true. If at the end of the series, return false.

Implements Barry::Builder.

Definition at line 111 of file builder.h.

template<class RecordT, class StorageT>
virtual uint8_t Barry::RecordBuilder< RecordT, StorageT >::GetRecType (  )  const [inline, virtual]

Called to retrive the unique ID for this record.

Implements Barry::Builder.

Definition at line 116 of file builder.h.

template<class RecordT, class StorageT>
virtual void Barry::RecordBuilder< RecordT, StorageT >::BuildHeader ( Data data,
size_t &  offset 
) [inline, virtual]

Functor member called by Controller::SaveDatabase() during processing.

Implements Barry::Builder.

Definition at line 128 of file builder.h.

template<class RecordT, class StorageT>
virtual void Barry::RecordBuilder< RecordT, StorageT >::BuildFields ( Data data,
size_t &  offset 
) [inline, virtual]

Called to build the record field data.

Store the raw data in data, using offset to know where to write. Be sure to update offset, and be sure to adjust the size of the data packet (possibly with Data::ReleaseBuffer()).

Implements Barry::Builder.

Definition at line 133 of file builder.h.


The documentation for this class was generated from the following file:
Generated on Wed Sep 24 21:27:32 2008 for Barry by  doxygen 1.5.1