DDraceNetwork Docs
CDbConnectionPool Class Reference

#include <connection_pool.h>

Classes

struct  CSharedData
 

Public Types

enum  Mode { READ , WRITE , WRITE_BACKUP , NUM_MODES }
 
typedef bool(* FRead) (IDbConnection *, const ISqlData *, char *pError, int ErrorSize)
 
typedef bool(* FWrite) (IDbConnection *, const ISqlData *, Write, char *pError, int ErrorSize)
 

Public Member Functions

 CDbConnectionPool ()
 
 ~CDbConnectionPool ()
 
CDbConnectionPooloperator= (const CDbConnectionPool &)=delete
 
void Print (IConsole *pConsole, Mode DatabaseMode)
 
void RegisterSqliteDatabase (Mode DatabaseMode, const char FileName[64])
 
void RegisterMysqlDatabase (Mode DatabaseMode, const CMysqlConfig *pMysqlConfig)
 
void Execute (FRead pFunc, std::unique_ptr< const ISqlData > pSqlRequestData, const char *pName)
 
void ExecuteWrite (FWrite pFunc, std::unique_ptr< const ISqlData > pSqlRequestData, const char *pName)
 
void OnShutdown ()
 

Static Private Member Functions

static bool ExecSqlFunc (IDbConnection *pConnection, struct CSqlExecData *pData, Write w)
 

Private Attributes

int m_InsertIdx = 0
 
bool m_Shutdown = false
 
std::shared_ptr< CSharedDatam_pShared
 
void * m_pWorkerThread = nullptr
 
void * m_pBackupThread = nullptr
 

Friends

class CWorker
 
class CBackup
 

Member Typedef Documentation

◆ FRead

typedef bool(* CDbConnectionPool::FRead) (IDbConnection *, const ISqlData *, char *pError, int ErrorSize)

◆ FWrite

typedef bool(* CDbConnectionPool::FWrite) (IDbConnection *, const ISqlData *, Write, char *pError, int ErrorSize)

Member Enumeration Documentation

◆ Mode

Enumerator
READ 
WRITE 
WRITE_BACKUP 
NUM_MODES 

Constructor & Destructor Documentation

◆ CDbConnectionPool()

CDbConnectionPool::CDbConnectionPool ( )

◆ ~CDbConnectionPool()

CDbConnectionPool::~CDbConnectionPool ( )

Member Function Documentation

◆ ExecSqlFunc()

bool CDbConnectionPool::ExecSqlFunc ( IDbConnection pConnection,
struct CSqlExecData pData,
Write  w 
)
staticprivate

◆ Execute()

void CDbConnectionPool::Execute ( FRead  pFunc,
std::unique_ptr< const ISqlData pSqlRequestData,
const char *  pName 
)

◆ ExecuteWrite()

void CDbConnectionPool::ExecuteWrite ( FWrite  pFunc,
std::unique_ptr< const ISqlData pSqlRequestData,
const char *  pName 
)

◆ OnShutdown()

void CDbConnectionPool::OnShutdown ( )

◆ operator=()

CDbConnectionPool & CDbConnectionPool::operator= ( const CDbConnectionPool )
delete

◆ Print()

void CDbConnectionPool::Print ( IConsole pConsole,
Mode  DatabaseMode 
)

◆ RegisterMysqlDatabase()

void CDbConnectionPool::RegisterMysqlDatabase ( Mode  DatabaseMode,
const CMysqlConfig pMysqlConfig 
)

◆ RegisterSqliteDatabase()

void CDbConnectionPool::RegisterSqliteDatabase ( Mode  DatabaseMode,
const char  FileName[64] 
)

Friends And Related Function Documentation

◆ CBackup

friend class CBackup
friend

◆ CWorker

friend class CWorker
friend

Member Data Documentation

◆ m_InsertIdx

int CDbConnectionPool::m_InsertIdx = 0
private

◆ m_pBackupThread

void* CDbConnectionPool::m_pBackupThread = nullptr
private

◆ m_pShared

std::shared_ptr<CSharedData> CDbConnectionPool::m_pShared
private

◆ m_pWorkerThread

void* CDbConnectionPool::m_pWorkerThread = nullptr
private

◆ m_Shutdown

bool CDbConnectionPool::m_Shutdown = false
private

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