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

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

#include <builder.h>

Inheritance diagram for Barry::RecordBuilder< RecordT, StorageT >:
Inheritance graph
[legend]
Collaboration diagram for Barry::RecordBuilder< RecordT, StorageT >:
Collaboration graph
[legend]

List of all members.

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.
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 void BuildHeader (Data &data, size_t &offset)
 Functor member called by Controller::SaveDatabase() during processing.
virtual void BuildFields (Data &data, size_t &offset, const IConverter *ic)
 Called to build the record field data.

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 91 of file builder.h.


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 99 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 106 of file builder.h.


Member Function Documentation

template<class RecordT, class StorageT>
virtual void Barry::RecordBuilder< RecordT, StorageT >::BuildFields ( Data data,
size_t &  offset,
const IConverter ic 
) [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 137 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 132 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 120 of file builder.h.

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 115 of file builder.h.


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208