QGIS API Documentation
2.4.0-Chugiak
|
#include <qgsconnectionpool.h>
Classes | |
struct | Item |
Public Member Functions | |
QgsConnectionPoolGroup (const QString &ci) | |
~QgsConnectionPoolGroup () | |
T | acquire () |
void | release (T conn) |
Static Public Attributes | |
static const int | maxConcurrentConnections |
Protected Member Functions | |
void | initTimer (QObject *parent) |
void | onConnectionExpired () |
Protected Attributes | |
QString | connInfo |
QStack< Item > | conns |
QMutex | connMutex |
QSemaphore | sem |
QTimer * | expirationTimer |
Template that stores data related to one server.
It is assumed that following functions exist:
Because of issues with templates and QObject's signals and slots, this class only provides helper functions for QObject-related functionality - the place which uses the template is resonsible for:
For an example on how to use the template class, have a look at the implementation in postgres/spatialite providers.
Definition at line 51 of file qgsconnectionpool.h.
|
inline |
Definition at line 63 of file qgsconnectionpool.h.
|
inline |
Definition at line 70 of file qgsconnectionpool.h.
References QgsConnectionPoolGroup< T >::Item::c, and QgsConnectionPoolGroup< T >::conns.
|
inline |
|
inlineprotected |
Definition at line 135 of file qgsconnectionpool.h.
References CONN_POOL_EXPIRATION_TIME, and QgsConnectionPoolGroup< T >::expirationTimer.
|
inlineprotected |
Definition at line 145 of file qgsconnectionpool.h.
References CONN_POOL_EXPIRATION_TIME, QgsConnectionPoolGroup< T >::connMutex, QgsConnectionPoolGroup< T >::conns, QgsConnectionPoolGroup< T >::expirationTimer, and index.
|
inline |
Definition at line 114 of file qgsconnectionpool.h.
References QgsConnectionPoolGroup< T >::Item::c, QgsConnectionPoolGroup< T >::connMutex, QgsConnectionPoolGroup< T >::conns, QgsConnectionPoolGroup< T >::expirationTimer, QgsConnectionPoolGroup< T >::Item::lastUsedTime, and QgsConnectionPoolGroup< T >::sem.
|
protected |
Definition at line 175 of file qgsconnectionpool.h.
Referenced by QgsConnectionPoolGroup< T >::acquire().
|
protected |
Definition at line 177 of file qgsconnectionpool.h.
Referenced by QgsConnectionPoolGroup< T >::acquire(), QgsConnectionPoolGroup< T >::onConnectionExpired(), and QgsConnectionPoolGroup< T >::release().
|
protected |
Definition at line 176 of file qgsconnectionpool.h.
Referenced by QgsConnectionPoolGroup< T >::acquire(), QgsConnectionPoolGroup< T >::onConnectionExpired(), QgsConnectionPoolGroup< T >::release(), and QgsConnectionPoolGroup< T >::~QgsConnectionPoolGroup().
|
protected |
Definition at line 179 of file qgsconnectionpool.h.
Referenced by QgsConnectionPoolGroup< T >::acquire(), QgsConnectionPoolGroup< T >::initTimer(), QgsConnectionPoolGroup< T >::onConnectionExpired(), and QgsConnectionPoolGroup< T >::release().
|
static |
Definition at line 55 of file qgsconnectionpool.h.
|
protected |
Definition at line 178 of file qgsconnectionpool.h.
Referenced by QgsConnectionPoolGroup< T >::acquire(), and QgsConnectionPoolGroup< T >::release().