|
QGIS API Documentation 3.99.0-Master (21b3aa880ba)
|
Template that stores data related to a connection to a single server or datasource. More...
#include <qgsconnectionpool.h>
Classes | |
| struct | Item |
Public Member Functions | |
| QgsConnectionPoolGroup (const QgsConnectionPoolGroup &other)=delete | |
| QgsConnectionPoolGroup (const QString &ci) | |
| Constructor for QgsConnectionPoolGroup, with the specified connection info. | |
| ~QgsConnectionPoolGroup () | |
| T | acquire (int timeout, bool requestMayBeNested) |
| Try to acquire a connection for a maximum of timeout milliseconds. | |
| void | invalidateConnections () |
| QgsConnectionPoolGroup & | operator= (const QgsConnectionPoolGroup &other)=delete |
| void | release (T conn) |
Protected Member Functions | |
| template<typename U> | |
| void | initTimer (U *parent) |
| Initializes the connection timeout handling. | |
| void | onConnectionExpired () |
Protected Attributes | |
| QList< T > | acquiredConns |
| QString | connInfo |
| QMutex | connMutex |
| QStack< Item > | conns |
| QTimer * | expirationTimer = nullptr |
| QSemaphore | sem |
Template that stores data related to a connection to a single server or datasource.
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 64 of file qgsconnectionpool.h.
|
inline |
Constructor for QgsConnectionPoolGroup, with the specified connection info.
Definition at line 77 of file qgsconnectionpool.h.
|
inline |
Definition at line 83 of file qgsconnectionpool.h.
|
delete |
|
inline |
Try to acquire a connection for a maximum of timeout milliseconds.
If timeout is a negative value the calling thread will be blocked until a connection becomes available. This is the default behavior.
nullptr if unsuccessful Definition at line 102 of file qgsconnectionpool.h.
|
inlineprotected |
Initializes the connection timeout handling.
Should be called from subclasses within their constructors, passing themselves as the parent.
Definition at line 226 of file qgsconnectionpool.h.
|
inline |
Definition at line 203 of file qgsconnectionpool.h.
|
inlineprotected |
Definition at line 237 of file qgsconnectionpool.h.
|
delete |
|
inline |
Definition at line 174 of file qgsconnectionpool.h.
|
protected |
Definition at line 269 of file qgsconnectionpool.h.
|
protected |
Definition at line 267 of file qgsconnectionpool.h.
|
protected |
Definition at line 270 of file qgsconnectionpool.h.
|
protected |
Definition at line 268 of file qgsconnectionpool.h.
|
protected |
Definition at line 272 of file qgsconnectionpool.h.
|
protected |
Definition at line 271 of file qgsconnectionpool.h.