Public Member Functions

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

Template class for easy creation of specific parser objects. More...

#include <parser.h>

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

List of all members.

Public Member Functions

 RecordParser (StorageT &storage)
 Constructor that references an externally managed storage object.
 RecordParser (StorageT *storage=0)
 Constructor that references a locally managed storage object.
virtual void ParseRecord (const DBData &data, const IConverter *ic)
 Called to parse sub fields in the raw data packet.

Detailed Description

template<class RecordT, class StorageT>
class Barry::RecordParser< RecordT, StorageT >

Template class for easy creation of specific parser objects.

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 286 of file parser.h.


Constructor & Destructor Documentation

template<class RecordT, class StorageT>
Barry::RecordParser< RecordT, StorageT >::RecordParser ( StorageT &  storage  )  [inline]

Constructor that references an externally managed storage object.

Definition at line 295 of file parser.h.

template<class RecordT, class StorageT>
Barry::RecordParser< RecordT, StorageT >::RecordParser ( StorageT *  storage = 0  )  [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 306 of file parser.h.


Member Function Documentation

template<class RecordT, class StorageT>
virtual void Barry::RecordParser< RecordT, StorageT >::ParseRecord ( const DBData data,
const IConverter ic 
) [inline, virtual]

Called to parse sub fields in the raw data packet.

Implements Barry::Parser.

Definition at line 329 of file parser.h.

References Barry::ParseDBData().

Here is the call graph for this function:


The documentation for this class was generated from the following file: