Barry::Builder Class Reference

#include <builder.h>

Inheritance diagram for Barry::Builder:

Barry::RecordBuilder< RecordT, StorageT > List of all members.

Detailed Description

Base class for the builder functor hierarchy.

This defines the API used by the Controller and Packet classes for building a raw device record to write to the device.

Definition at line 37 of file builder.h.

Public Member Functions

 Builder ()
virtual ~Builder ()
virtual bool Retrieve (unsigned int databaseId)=0
 Called first in the sequence, to allow the application to load the needed data from memory, disk, etc.
virtual uint8_t GetRecType () const=0
 Called to retrive the unique ID for this record.
virtual void BuildHeader (Data &data, size_t &offset)=0
 Called before BuildFields() in order to build the header for this record.
virtual void BuildFields (Data &data, size_t &offset)=0
 Called to build the record field data.


Member Function Documentation

virtual bool Barry::Builder::Retrieve ( unsigned int  databaseId  )  [pure 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.

Implemented in Barry::RecordBuilder< RecordT, StorageT >.

Referenced by Barry::DBPacket::SetRecord(), and Barry::DBPacket::SetRecordByIndex().

virtual uint8_t Barry::Builder::GetRecType (  )  const [pure virtual]

Called to retrive the unique ID for this record.

Implemented in Barry::RecordBuilder< RecordT, StorageT >.

Referenced by Barry::DBPacket::SetRecord().

virtual void Barry::Builder::BuildHeader ( Data data,
size_t &  offset 
) [pure virtual]

Called before BuildFields() in order to build the header for this record.

Store the raw data in data, at the offset given in offset. When finished, update offset to point to the next spot to put new data.

Implemented in Barry::RecordBuilder< RecordT, StorageT >.

Referenced by Barry::DBPacket::SetRecord().

virtual void Barry::Builder::BuildFields ( Data data,
size_t &  offset 
) [pure 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()).

Implemented in Barry::RecordBuilder< RecordT, StorageT >.

Referenced by Barry::DBPacket::SetRecord(), and Barry::DBPacket::SetRecordByIndex().


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