Public Member Functions

Barry::Mode::Desktop Class Reference

The main interface class to the device databases. More...

#include <m_desktop.h>

Inheritance diagram for Barry::Mode::Desktop:
Inheritance graph
[legend]
Collaboration diagram for Barry::Mode::Desktop:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const DatabaseDatabaseGetDBDB () const
 Returns DatabaseDatabase object for this connection.
unsigned int GetDBID (const std::string &name) const
 Get numeric database ID by name.
unsigned int GetDBCommand (CommandType ct)
 Get database command from command table.
void GetRecordStateTable (unsigned int dbId, RecordStateTable &result)
 Retrieve the record state table from the handheld device, using the given database ID.
void AddRecord (unsigned int dbId, Builder &build)
 Adds a record to the specified database.
void GetRecord (unsigned int dbId, unsigned int stateTableIndex, Parser &parser)
 Retrieves a specific record from the specified database.
void SetRecord (unsigned int dbId, unsigned int stateTableIndex, Builder &build)
 Overwrites a specific record in the device as identified by the stateTableIndex.
void ClearDirty (unsigned int dbId, unsigned int stateTableIndex)
 Clears the dirty flag on the specified record in the specified database.
void DeleteRecord (unsigned int dbId, unsigned int stateTableIndex)
 Deletes the specified record in the specified database.
void LoadDatabase (unsigned int dbId, Parser &parser)
 Retrieve a database from the handheld device, using the given parser to parse the resulting data, and optionally store it.

Detailed Description

The main interface class to the device databases.

To use this class, use the following steps:

Definition at line 58 of file m_desktop.h.


Member Function Documentation

void Barry::Mode::Desktop::AddRecord ( unsigned int  dbId,
Builder build 
)

Adds a record to the specified database.

RecordId is retrieved from build, and duplicate IDs are allowed by the device (i.e. you can have two records with the same ID) but *not* recommended!

Definition at line 201 of file m_desktop.cc.

void Barry::Mode::Desktop::ClearDirty ( unsigned int  dbId,
unsigned int  stateTableIndex 
)

Clears the dirty flag on the specified record in the specified database.

Definition at line 322 of file m_desktop.cc.

void Barry::Mode::Desktop::DeleteRecord ( unsigned int  dbId,
unsigned int  stateTableIndex 
)

Deletes the specified record in the specified database.

Definition at line 341 of file m_desktop.cc.

unsigned int Barry::Mode::Desktop::GetDBCommand ( CommandType  ct  ) 
const DatabaseDatabase& Barry::Mode::Desktop::GetDBDB (  )  const [inline]

Returns DatabaseDatabase object for this connection.

Must call Open() first, which loads the DBDB.

Definition at line 94 of file m_desktop.h.

Referenced by Barry::TimeZones::IsLoadable().

Here is the caller graph for this function:

unsigned int Barry::Mode::Desktop::GetDBID ( const std::string &  name  )  const

Get numeric database ID by name.

Parameters:
[in] name Name of database, which matches one of the names listed in GetDBDB()
Exceptions:
Barry::Error Thrown if name not found.

Definition at line 123 of file m_desktop.cc.

Referenced by Barry::TimeZones::TimeZones().

Here is the caller graph for this function:

void Barry::Mode::Desktop::GetRecord ( unsigned int  dbId,
unsigned int  stateTableIndex,
Parser parser 
)

Retrieves a specific record from the specified database.

The stateTableIndex comes from the GetRecordStateTable() function. GetRecord() does not clear the dirty flag.

Definition at line 236 of file m_desktop.cc.

void Barry::Mode::Desktop::GetRecordStateTable ( unsigned int  dbId,
RecordStateTable result 
)

Retrieve the record state table from the handheld device, using the given database ID.

Results will be stored in result, which will be cleared before adding.

Definition at line 175 of file m_desktop.cc.

void Barry::Mode::Desktop::LoadDatabase ( unsigned int  dbId,
Parser parser 
)

Retrieve a database from the handheld device, using the given parser to parse the resulting data, and optionally store it.

See the RecordParser<> template to create a parser object. The RecordParser<> template allows custom storage based on the type of database record retrieved. The database ID and the parser Record type must match.

Parameters:
[in] dbId Database Database ID - use GetDBID()
[out] parser Parser object which parses the resulting protocol data, and optionally stores it in a custom fashion. See the RecordParser<> template.
Exceptions:
Barry::Error Thrown on protocol error.
std::logic_error Thrown if not in Desktop mode.

Definition at line 378 of file m_desktop.cc.

References Barry::Parser::ParseRecord().

Referenced by Barry::TimeZones::TimeZones().

Here is the call graph for this function:

Here is the caller graph for this function:

void Barry::Mode::Desktop::SetRecord ( unsigned int  dbId,
unsigned int  stateTableIndex,
Builder build 
)

Overwrites a specific record in the device as identified by the stateTableIndex.

Definition at line 286 of file m_desktop.cc.


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