#include <parser.h>
Inheritance diagram for Barry::RecordParser< RecordT, StorageT >:
This template takes the following template arguments:
Example LoadDatabase() call:
struct StoreContact { std::vector<Contact> &array; StoreContact(std::vector<Contact> &a) : array(a) {} void operator() (const Contact &c) { array.push_back(c); } };
Controller con(probeResult); con.OpenMode(Controller::Desktop); std::vector<Contact> contactList; StoreContact storage(contactList); RecordParser<Contact, StoreContact> parser(storage); con.LoadDatabase(con.GetDBID("Address Book"), parser);
Definition at line 111 of file parser.h.
Public Member Functions | |
RecordParser (StorageT &storage) | |
Constructor that references an externally managed storage object. | |
RecordParser (StorageT *storage) | |
Constructor that references a locally managed storage object. | |
~RecordParser () | |
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. |
Barry::RecordParser< RecordT, StorageT >::RecordParser | ( | StorageT & | storage | ) | [inline] |
Barry::RecordParser< RecordT, StorageT >::RecordParser | ( | StorageT * | storage | ) | [inline] |
virtual void Barry::RecordParser< RecordT, StorageT >::Clear | ( | ) | [inline, virtual] |
virtual void Barry::RecordParser< RecordT, StorageT >::SetIds | ( | uint8_t | RecType, | |
uint32_t | UniqueId | |||
) | [inline, virtual] |
virtual void Barry::RecordParser< RecordT, StorageT >::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 from Barry::Parser.
virtual void Barry::RecordParser< RecordT, StorageT >::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 from Barry::Parser.
virtual void Barry::RecordParser< RecordT, StorageT >::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 from Barry::Parser.