#include <parser.h>
Note that this container owns *all* Parser objects, and will free them upon destruction.
Incoming records that have no matching parser are passed to the default parser object, if one exists, otherwise they are dropped silently. The default parser object is also owned by the container, and will be freed on destruction.
Do NOT derive your own personal parser classes from this, unless you are perfectly confident that you will catch future API changes on the devel tree without the compiler's help.
Definition at line 397 of file parser.h.
Public Member Functions | |
void | Add (const std::string &dbname, Parser *parser) |
Adds given parser to list and takes ownership of it. | |
void | Add (RecordParserBase *parser) |
Adds given parser to list and takes ownership of it. | |
template<class RecordT> | |
void | Add (AllRecordStore &store) |
Creates a RecordParser<> object using the given record type and AllRecordStore. | |
template<class RecordT, class StorageT> | |
void | Add (StorageT *store) |
Two helper template functions that create the RecordParser<> automatically based on the function call. | |
bool | Add (const std::string &dbname, std::ostream &os) |
Creates a RecordParser<> object for the given database name, using DumpStore<> with the given stream for the output, and adds it to list. | |
bool | Add (const std::string &dbname, AllRecordStore &store) |
Creates a RecordParser<> object for the given database name, using the given store object. | |
virtual void | ParseRecord (const DBData &data, const IConverter *ic) |
Called to parse sub fields in the raw data packet. |
void Barry::MultiRecordParser::Add | ( | const std::string & | dbname, | |
Parser * | parser | |||
) |
void Barry::MultiRecordParser::Add | ( | RecordParserBase * | parser | ) |
void Barry::MultiRecordParser::Add | ( | AllRecordStore & | store | ) | [inline] |
Creates a RecordParser<> object using the given record type and AllRecordStore.
Does NOT take ownership of the store object, since it can be used multiple times for multiple records.
void Barry::MultiRecordParser::Add | ( | StorageT * | store | ) | [inline] |
bool Barry::MultiRecordParser::Add | ( | const std::string & | dbname, | |
std::ostream & | os | |||
) |
bool Barry::MultiRecordParser::Add | ( | const std::string & | dbname, | |
AllRecordStore & | store | |||
) |
void Barry::MultiRecordParser::ParseRecord | ( | const DBData & | data, | |
const IConverter * | ic | |||
) | [virtual] |
Called to parse sub fields in the raw data packet.
Implements Barry::Parser.
Definition at line 161 of file parser.cc.
References Barry::DBData::GetDBName(), and Barry::Parser::ParseRecord().