relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
relx::connection::PostgreSQLConnectionPool::PooledConnection Class Reference

A wrapper for a connection that automatically returns it to the pool. More...

#include <relx/connection/postgresql_connection_pool.hpp>

Public Member Functions

 PooledConnection (std::shared_ptr< PostgreSQLConnection > connection, const std::shared_ptr< PostgreSQLConnectionPool > &pool)
 Constructor takes a connection and its parent pool.
 
 ~PooledConnection ()
 Destructor automatically returns connection to pool if available.
 
 PooledConnection (const PooledConnection &)=delete
 
PooledConnectionoperator= (const PooledConnection &)=delete
 
 PooledConnection (PooledConnection &&)=default
 
PooledConnectionoperator= (PooledConnection &&)=default
 
PostgreSQLConnectionoperator-> ()
 Forward -> operator to the underlying connection.
 
const PostgreSQLConnectionoperator-> () const
 Forward const -> operator to the underlying connection.
 
 operator bool () const
 Allow checking if connection is valid.
 

Detailed Description

A wrapper for a connection that automatically returns it to the pool.

Definition at line 144 of file postgresql_connection_pool.hpp.

Constructor & Destructor Documentation

◆ PooledConnection() [1/3]

relx::connection::PostgreSQLConnectionPool::PooledConnection::PooledConnection ( std::shared_ptr< PostgreSQLConnection connection,
const std::shared_ptr< PostgreSQLConnectionPool > &  pool 
)
inline

Constructor takes a connection and its parent pool.

Parameters
connectionThe database connection
poolThe connection pool that owns this connection

Definition at line 153 of file postgresql_connection_pool.hpp.

◆ ~PooledConnection()

relx::connection::PostgreSQLConnectionPool::PooledConnection::~PooledConnection ( )
inline

Destructor automatically returns connection to pool if available.

Definition at line 158 of file postgresql_connection_pool.hpp.

◆ PooledConnection() [2/3]

relx::connection::PostgreSQLConnectionPool::PooledConnection::PooledConnection ( const PooledConnection )
delete

◆ PooledConnection() [3/3]

relx::connection::PostgreSQLConnectionPool::PooledConnection::PooledConnection ( PooledConnection &&  )
default

Member Function Documentation

◆ operator bool()

relx::connection::PostgreSQLConnectionPool::PooledConnection::operator bool ( ) const
inlineexplicit

Allow checking if connection is valid.

Definition at line 183 of file postgresql_connection_pool.hpp.

◆ operator->() [1/2]

PostgreSQLConnection * relx::connection::PostgreSQLConnectionPool::PooledConnection::operator-> ( )
inline

Forward -> operator to the underlying connection.

Definition at line 177 of file postgresql_connection_pool.hpp.

◆ operator->() [2/2]

const PostgreSQLConnection * relx::connection::PostgreSQLConnectionPool::PooledConnection::operator-> ( ) const
inline

Forward const -> operator to the underlying connection.

Definition at line 180 of file postgresql_connection_pool.hpp.

◆ operator=() [1/2]

PooledConnection & relx::connection::PostgreSQLConnectionPool::PooledConnection::operator= ( const PooledConnection )
delete

◆ operator=() [2/2]

PooledConnection & relx::connection::PostgreSQLConnectionPool::PooledConnection::operator= ( PooledConnection &&  )
default

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