MythTV  master
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
MDBManager Class Reference

DB connection pool, used by MSqlQuery. Do not use directly. More...

#include <mythdbcon.h>

Collaboration diagram for MDBManager:
Collaboration graph
[legend]

Public Member Functions

 MDBManager (void)
 
 ~MDBManager (void)
 
void CloseDatabases (void)
 
void PurgeIdleConnections (bool leaveOne=false)
 

Protected Member Functions

MSqlDatabasepopConnection (bool reuse)
 
void pushConnection (MSqlDatabase *db)
 
MSqlDatabasegetSchedCon (void)
 
MSqlDatabasegetDDCon (void)
 

Private Types

typedef QList< MSqlDatabase * > DBList
 

Private Member Functions

MSqlDatabasegetStaticCon (MSqlDatabase **dbcon, QString name)
 

Private Attributes

QMutex m_lock
 
QHash< QThread *, DBListm_pool
 
QHash< QThread *, MSqlDatabase * > m_inuse
 
QHash< QThread *, int > m_inuse_count
 
int m_nextConnID
 
int m_connCount
 
MSqlDatabasem_schedCon
 
MSqlDatabasem_DDCon
 
QHash< QThread *, DBListm_static_pool
 

Friends

class MSqlQuery
 

Detailed Description

DB connection pool, used by MSqlQuery. Do not use directly.

Definition at line 53 of file mythdbcon.h.

Member Typedef Documentation

◆ DBList

typedef QList<MSqlDatabase*> MDBManager::DBList
private

Definition at line 74 of file mythdbcon.h.

Constructor & Destructor Documentation

◆ MDBManager()

MDBManager::MDBManager ( void  )

Definition at line 282 of file mythdbcon.cpp.

◆ ~MDBManager()

MDBManager::~MDBManager ( void  )

Definition at line 291 of file mythdbcon.cpp.

Member Function Documentation

◆ CloseDatabases()

void MDBManager::CloseDatabases ( void  )

Definition at line 479 of file mythdbcon.cpp.

Referenced by MythContextPrivate::ResetDatabase(), and ~MDBManager().

◆ PurgeIdleConnections()

void MDBManager::PurgeIdleConnections ( bool  leaveOne = false)

Definition at line 385 of file mythdbcon.cpp.

Referenced by popConnection(), and pushConnection().

◆ popConnection()

MSqlDatabase * MDBManager::popConnection ( bool  reuse)
protected

Definition at line 307 of file mythdbcon.cpp.

Referenced by MSqlQuery::InitCon(), and MSqlQuery::testDBConnection().

◆ pushConnection()

void MDBManager::pushConnection ( MSqlDatabase db)
protected

◆ getSchedCon()

MSqlDatabase * MDBManager::getSchedCon ( void  )
protected

Definition at line 469 of file mythdbcon.cpp.

Referenced by MSqlQuery::SchedCon().

◆ getDDCon()

MSqlDatabase * MDBManager::getDDCon ( void  )
protected

Definition at line 474 of file mythdbcon.cpp.

Referenced by MSqlQuery::DDCon().

◆ getStaticCon()

MSqlDatabase * MDBManager::getStaticCon ( MSqlDatabase **  dbcon,
QString  name 
)
private

Definition at line 450 of file mythdbcon.cpp.

Referenced by getDDCon(), and getSchedCon().

Friends And Related Function Documentation

◆ MSqlQuery

friend class MSqlQuery
friend

Definition at line 55 of file mythdbcon.h.

Member Data Documentation

◆ m_lock

QMutex MDBManager::m_lock
private

Definition at line 73 of file mythdbcon.h.

Referenced by CloseDatabases(), popConnection(), PurgeIdleConnections(), and pushConnection().

◆ m_pool

QHash<QThread*, DBList> MDBManager::m_pool
private

Definition at line 75 of file mythdbcon.h.

Referenced by CloseDatabases(), popConnection(), PurgeIdleConnections(), and pushConnection().

◆ m_inuse

QHash<QThread*, MSqlDatabase*> MDBManager::m_inuse
private

Definition at line 77 of file mythdbcon.h.

Referenced by popConnection(), and pushConnection().

◆ m_inuse_count

QHash<QThread*, int> MDBManager::m_inuse_count
private

Definition at line 78 of file mythdbcon.h.

Referenced by popConnection(), and pushConnection().

◆ m_nextConnID

int MDBManager::m_nextConnID
private

Definition at line 81 of file mythdbcon.h.

Referenced by MDBManager(), popConnection(), and PurgeIdleConnections().

◆ m_connCount

int MDBManager::m_connCount
private

◆ m_schedCon

MSqlDatabase* MDBManager::m_schedCon
private

Definition at line 84 of file mythdbcon.h.

Referenced by CloseDatabases(), getSchedCon(), MDBManager(), and ~MDBManager().

◆ m_DDCon

MSqlDatabase* MDBManager::m_DDCon
private

Definition at line 85 of file mythdbcon.h.

Referenced by CloseDatabases(), getDDCon(), MDBManager(), and ~MDBManager().

◆ m_static_pool

QHash<QThread*, DBList> MDBManager::m_static_pool
private

Definition at line 86 of file mythdbcon.h.

Referenced by CloseDatabases(), and getStaticCon().


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