te::pgis::ScopedConnection Class Reference

A class that control the use of the connection to a PostgreSQL database. More...

#include <ScopedConnection.h>

Public Member Functions

Connectionoperator-> () const
 
void release ()
 Release connection. More...
 
 ScopedConnection (ConnectionPool *pool, int id=-1)
 Constructor. More...
 
 ~ScopedConnection ()
 Destructor. More...
 

Protected Member Functions

ScopedConnectionoperator= (const ScopedConnection &)
 
 ScopedConnection (const ScopedConnection &)
 

Private Attributes

Connectionm_connection
 An available connection that will be released when the scopedConnection is deleted. More...
 
ConnectionPoolm_connectionPool
 The connection pool associated to the connection. More...
 

Detailed Description

A class that control the use of the connection to a PostgreSQL database.

This class control the use of the connection and release the connection to the connectionPool.

See also
Connection

Definition at line 48 of file ScopedConnection.h.

Constructor & Destructor Documentation

te::pgis::ScopedConnection::ScopedConnection ( ConnectionPool pool,
int  id = -1 
)

Constructor.

Definition at line 31 of file ScopedConnection.cpp.

References te::pgis::ConnectionPool::getConnection(), m_connection, and m_connectionPool.

te::pgis::ScopedConnection::~ScopedConnection ( )

Destructor.

Definition at line 36 of file ScopedConnection.cpp.

References release().

te::pgis::ScopedConnection::ScopedConnection ( const ScopedConnection )
protected

Member Function Documentation

te::pgis::Connection * te::pgis::ScopedConnection::operator-> ( ) const

Member access operator.

Definition at line 48 of file ScopedConnection.cpp.

References m_connection.

ScopedConnection& te::pgis::ScopedConnection::operator= ( const ScopedConnection )
protected
void te::pgis::ScopedConnection::release ( )

Release connection.

Definition at line 40 of file ScopedConnection.cpp.

References m_connection, m_connectionPool, and te::pgis::ConnectionPool::release().

Referenced by ~ScopedConnection().

Member Data Documentation

Connection* te::pgis::ScopedConnection::m_connection
private

An available connection that will be released when the scopedConnection is deleted.

Definition at line 72 of file ScopedConnection.h.

Referenced by operator->(), release(), and ScopedConnection().

ConnectionPool* te::pgis::ScopedConnection::m_connectionPool
private

The connection pool associated to the connection.

Definition at line 73 of file ScopedConnection.h.

Referenced by release(), and ScopedConnection().


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