Barry::Parser Class Reference

#include <parser.h>

Inheritance diagram for Barry::Parser:

Barry::RecordParser< RecordT, StorageT > ChecksumParser DataDumpParser List of all members.

Detailed Description

Base class for the parser hierarchy.

If in debug mode, this class can be used as a null parser. Call Init() and the protocol will be dumped to stdout and no parsing will be done.

This class provides the interface that the Controller class uses to pass raw data it reads from the device. The Controller, along with the Packet class, calls each of the virtual functions below in the same order.

Definition at line 48 of file parser.h.

Public Member Functions

 Parser ()
virtual ~Parser ()
virtual void Clear ()
 Reset and prepare for a new raw data packet.
virtual void SetIds (uint8_t RecType, uint32_t UniqueId)
 Stores the IDs.
virtual void ParseHeader (const Data &data, size_t &offset)
 Called to parse the header portion of the raw data packet.
virtual void ParseFields (const Data &data, size_t &offset)
 Called to parse sub fields in the raw data packet.
virtual void Store ()
 Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc.


Member Function Documentation

virtual void Barry::Parser::Clear (  )  [inline, virtual]

Reset and prepare for a new raw data packet.

Reimplemented in Barry::RecordParser< RecordT, StorageT >, and ChecksumParser.

Definition at line 55 of file parser.h.

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

virtual void Barry::Parser::SetIds ( uint8_t  RecType,
uint32_t  UniqueId 
) [inline, virtual]

Stores the IDs.

Reimplemented in Barry::RecordParser< RecordT, StorageT >, ChecksumParser, and DataDumpParser.

Definition at line 58 of file parser.h.

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

virtual void Barry::Parser::ParseHeader ( const Data data,
size_t &  offset 
) [inline, virtual]

Called to parse the header portion of the raw data packet.

data contains the entire packet, and offset contains the location at which to start parsing.

Reimplemented in Barry::RecordParser< RecordT, StorageT >.

Definition at line 63 of file parser.h.

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

virtual void Barry::Parser::ParseFields ( const Data data,
size_t &  offset 
) [inline, virtual]

Called to parse sub fields in the raw data packet.

The same data is passed as was passed in ParseHeader, only the offset will be updated if it was advanced during the header parsing.

Reimplemented in Barry::RecordParser< RecordT, StorageT >, ChecksumParser, and DataDumpParser.

Definition at line 69 of file parser.h.

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

virtual void Barry::Parser::Store (  )  [inline, virtual]

Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc.

Reimplemented in Barry::RecordParser< RecordT, StorageT >, and ChecksumParser.

Definition at line 73 of file parser.h.

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


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