QGIS API Documentation
2.8.2-Wien
|
Template class responsible for keeping a pool of open connections. More...
#include <qgsconnectionpool.h>
Public Types | |
typedef QMap< QString, T_Group * > | T_Groups |
Public Member Functions | |
T | acquireConnection (const QString &connInfo) |
Try to acquire a connection: if no connections are available, the thread will get blocked. | |
void | releaseConnection (T conn) |
Release an existing connection so it will get back into the pool and can be reused. |
Protected Attributes | |
T_Groups | mGroups |
Template class responsible for keeping a pool of open connections.
This is desired to avoid the overhead of creation of new connection everytime.
The methods are thread safe.
The connection pool has a limit on maximum number of concurrent connections (per server), once the limit is reached, the acquireConnection() function will block. All connections that have been acquired must be then released with releaseConnection() function.
When the connections are not used for some time, they will get closed automatically to save resources.
Definition at line 199 of file qgsconnectionpool.h.
typedef QMap<QString, T_Group*> QgsConnectionPool< T, T_Group >::T_Groups |
Definition at line 203 of file qgsconnectionpool.h.
|
inline |
Try to acquire a connection: if no connections are available, the thread will get blocked.
Definition at line 207 of file qgsconnectionpool.h.
|
inline |
Release an existing connection so it will get back into the pool and can be reused.
Definition at line 222 of file qgsconnectionpool.h.
|
protected |
Definition at line 234 of file qgsconnectionpool.h.