QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
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 cannot be copied. More... | |
QgsConnectionPoolGroup (const QString &ci) | |
~QgsConnectionPoolGroup () | |
T | acquire (int timeout, bool requestMayBeNested) |
Try to acquire a connection for a maximum of timeout milliseconds. More... | |
void | invalidateConnections () |
QgsConnectionPoolGroup & | operator= (const QgsConnectionPoolGroup &other)=delete |
QgsConnectionPoolGroup cannot be copied. More... | |
void | release (T conn) |
Protected Member Functions | |
void | initTimer (QObject *parent) |
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 63 of file qgsconnectionpool.h.
|
inline |
Definition at line 73 of file qgsconnectionpool.h.
|
inline |
Definition at line 79 of file qgsconnectionpool.h.
|
delete |
QgsConnectionPoolGroup cannot be copied.
|
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 99 of file qgsconnectionpool.h.
|
inlineprotected |
Definition at line 202 of file qgsconnectionpool.h.
|
inline |
Definition at line 187 of file qgsconnectionpool.h.
|
inlineprotected |
Definition at line 213 of file qgsconnectionpool.h.
|
delete |
QgsConnectionPoolGroup cannot be copied.
|
inline |
Definition at line 160 of file qgsconnectionpool.h.
|
protected |
Definition at line 245 of file qgsconnectionpool.h.
|
protected |
Definition at line 243 of file qgsconnectionpool.h.
|
protected |
Definition at line 246 of file qgsconnectionpool.h.
|
protected |
Definition at line 244 of file qgsconnectionpool.h.
|
protected |
Definition at line 248 of file qgsconnectionpool.h.
|
protected |
Definition at line 247 of file qgsconnectionpool.h.