DbInterface Class Reference

#include <DbInterface.h>

Inheritance diagram for DbInterface:

MysqlInterface SqliteInterface List of all members.

Public Member Functions

 DbInterface ()
virtual ~DbInterface ()
virtual int connect ()=0
virtual int select_db (std::string dbname)=0
virtual int query (std::string dbname, std::string query, DatabaseRecordVector &records)=0
virtual int query (std::string dbname, std::string query)=0
virtual int disconnect ()=0
bool is_connected ()
void set_host (std::string host)
void set_user (std::string user)
void set_passwd (std::string passwd)
void set_dbpath (std::string path)
void set_reuse_connection (bool flag)

Protected Attributes

bool m_isConnected
bool m_reuseConnection
std::string m_dbName
std::string m_dbHost
std::string m_dbUser
std::string m_dbPasswd
std::string m_dbPath

Detailed Description

Definition at line 10 of file DbInterface.h.


Constructor & Destructor Documentation

DbInterface::DbInterface (  ) 

Definition at line 3 of file DbInterface.cxx.

References m_dbName, m_isConnected, and m_reuseConnection.

00004 {
00005   m_isConnected = false;
00006   m_reuseConnection = false;
00007   m_dbName="offlinedb";
00008 }

DbInterface::~DbInterface (  )  [virtual]

Definition at line 10 of file DbInterface.cxx.

00011 {
00012 }


Member Function Documentation

virtual int DbInterface::connect (  )  [pure virtual]

Implemented in MysqlInterface, and SqliteInterface.

Referenced by DatabaseSvc::initialize().

virtual int DbInterface::disconnect (  )  [pure virtual]

Implemented in MysqlInterface, and SqliteInterface.

Referenced by DatabaseSvc::finalize().

bool DbInterface::is_connected (  )  [inline]

Definition at line 27 of file DbInterface.h.

References m_isConnected.

Referenced by DatabaseSvc::finalize().

00027 { return m_isConnected; }  

virtual int DbInterface::query ( std::string  dbname,
std::string  query 
) [pure virtual]

Implemented in MysqlInterface, and SqliteInterface.

virtual int DbInterface::query ( std::string  dbname,
std::string  query,
DatabaseRecordVector records 
) [pure virtual]

Implemented in MysqlInterface, and SqliteInterface.

Referenced by DatabaseSvc::query().

virtual int DbInterface::select_db ( std::string  dbname  )  [pure virtual]

Implemented in MysqlInterface, and SqliteInterface.

void DbInterface::set_dbpath ( std::string  path  )  [inline]

Definition at line 32 of file DbInterface.h.

References m_dbPath.

Referenced by DatabaseSvc::initialize().

00032 {m_dbPath=path;};

void DbInterface::set_host ( std::string  host  )  [inline]

Definition at line 29 of file DbInterface.h.

References m_dbHost.

Referenced by DatabaseSvc::initialize().

00029 {m_dbHost=host;};

void DbInterface::set_passwd ( std::string  passwd  )  [inline]

Definition at line 31 of file DbInterface.h.

References m_dbPasswd.

Referenced by DatabaseSvc::initialize().

00031 {m_dbPasswd=passwd;};

void DbInterface::set_reuse_connection ( bool  flag  )  [inline]

Definition at line 33 of file DbInterface.h.

References m_reuseConnection.

Referenced by DatabaseSvc::initialize().

void DbInterface::set_user ( std::string  user  )  [inline]

Definition at line 30 of file DbInterface.h.

References m_dbUser.

Referenced by DatabaseSvc::initialize().

00030 {m_dbUser=user;};


Member Data Documentation

std::string DbInterface::m_dbHost [protected]

Definition at line 41 of file DbInterface.h.

Referenced by MysqlInterface::connect(), MysqlInterface::query(), MysqlInterface::select_db(), and set_host().

std::string DbInterface::m_dbName [protected]

Definition at line 39 of file DbInterface.h.

Referenced by MysqlInterface::connect(), DbInterface(), SqliteInterface::disconnect(), MysqlInterface::query(), and SqliteInterface::select_db().

std::string DbInterface::m_dbPasswd [protected]

Definition at line 43 of file DbInterface.h.

Referenced by MysqlInterface::connect(), MysqlInterface::query(), MysqlInterface::select_db(), and set_passwd().

std::string DbInterface::m_dbPath [protected]

Definition at line 44 of file DbInterface.h.

Referenced by SqliteInterface::select_db(), and set_dbpath().

std::string DbInterface::m_dbUser [protected]

Definition at line 42 of file DbInterface.h.

Referenced by MysqlInterface::connect(), MysqlInterface::query(), MysqlInterface::select_db(), and set_user().

bool DbInterface::m_isConnected [protected]

Definition at line 33 of file DbInterface.h.

Referenced by SqliteInterface::connect(), MysqlInterface::connect(), DbInterface(), SqliteInterface::disconnect(), MysqlInterface::disconnect(), is_connected(), and SqliteInterface::select_db().

bool DbInterface::m_reuseConnection [protected]

Definition at line 37 of file DbInterface.h.

Referenced by MysqlInterface::connect(), DbInterface(), MysqlInterface::query(), and set_reuse_connection().


Generated on Tue Nov 29 23:18:10 2016 for BOSS_7.0.2 by  doxygen 1.4.7