DB Class Reference

DB deals with the database backend. More...

#include <db.h>

Inheritance diagram for DB:

Inheritance graph
[legend]
Collaboration diagram for DB:

Collaboration graph
[legend]

Public Types

enum  RecordStatus { unknown, waiting, registered }
 enum of record (triplet) states More...
typedef std::vector< std::string > ParamVector

Public Member Functions

 DB () throw (std::exception)
void list_drivers (std::ostream &os)
 list installed drivers (see http://dbi.sf.net for more drivers)
 ~DB ()
std::string getConError (const std::string &) const
 
Returns:
a string with error msg from dbi

void createTable (const class WLStaticDef &staticDef) throw (std::exception)
 create a table if it doesnt exist
dbi_result executeSQL (const std::string &sql) throw (std::exception)
virtual int handle_signal (int signum)
 signal handling

Protected Member Functions

const std::string trimLastByte (std::string)
std::string getSqlCondition (const WLCompares &compares, const Triplet &triplet) const
const std::string numToStr (unsigned) const
std::string getWeakHost (const std::string &) const throw (std::exception)
void open () throw (std::exception)
 open a db connection
void close ()
 destroy db connection
void init_wlMods ()
 initialise wl modules based on config

Detailed Description

DB deals with the database backend.

Author:
Michael Moritz

Definition at line 44 of file db.h.


Member Enumeration Documentation

enum DB::RecordStatus

enum of record (triplet) states

Enumerator:
unknown  triplet is unknown, has been added to db with time and count 0
waiting  triplet is known, time it has been in db is less timeout and count = 0
registered  triplet is registered, count > 1 and/or time > timeout

Definition at line 51 of file db.h.


Member Function Documentation

void DB::open (  )  throw (std::exception) [protected]

open a db connection

older version of libdbi expected value to be non-const

Definition at line 99 of file db.cpp.

References createTable(), getConError(), Cfg::getDbParamVector(), Cfg::getDbType(), init_wlMods(), Cfg::isModeInit(), Cfg::isVerbose(), and list_drivers().

Referenced by DB().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Tue Jul 24 16:36:54 2007 for gps by  doxygen 1.5.1