ScopedConnection.h
Go to the documentation of this file.
1
/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3
This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5
TerraLib is free software: you can redistribute it and/or modify
6
it under the terms of the GNU Lesser General Public License as published by
7
the Free Software Foundation, either version 3 of the License,
8
or (at your option) any later version.
9
10
TerraLib is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU Lesser General Public License for more details.
14
15
You should have received a copy of the GNU Lesser General Public License
16
along with TerraLib. See COPYING. If not, write to
17
TerraLib Team at <terralib-team@terralib.org>.
18
*/
19
20
/*!
21
\file terralib/postgis/ScopedConnection.h
22
23
\brief A class that control the use of connection to a PostgreSQL database.
24
*/
25
26
#ifndef __TERRALIB_POSTGIS_INTERNAL_SCOPEDCONNECTION_H
27
#define __TERRALIB_POSTGIS_INTERNAL_SCOPEDCONNECTION_H
28
29
// TerraLib
30
#include "
Config.h
"
31
32
namespace
te
33
{
34
namespace
pgis
35
{
36
class
Connection;
37
class
ConnectionPool;
38
39
/*!
40
\class ScopedConnection
41
42
\brief A class that control the use of the connection to a PostgreSQL database.
43
44
This class control the use of the connection and release the connection to the connectionPool.
45
46
\sa Connection
47
*/
48
class
TEPGISEXPORT
ScopedConnection
49
{
50
public
:
51
52
/*! \brief Constructor. */
53
ScopedConnection
(
ConnectionPool
* pool,
int
id
= -1);
54
55
/*! \brief Destructor. */
56
~ScopedConnection
();
57
58
/*! \brief Release connection. */
59
void
release
();
60
61
/*! Member access operator. */
62
Connection
*
operator->
()
const
;
63
64
protected
:
65
66
ScopedConnection
(
const
ScopedConnection
&);
67
68
ScopedConnection
&
operator=
(
const
ScopedConnection
&);
69
70
private
:
71
72
Connection
*
m_connection
;
//!< An available connection that will be released when the scopedConnection is deleted.
73
ConnectionPool
*
m_connectionPool
;
//!< The connection pool associated to the connection.
74
75
};
76
77
}
// end namespace pgis
78
}
// end namespace te
79
80
#endif
// __TERRALIB_POSTGIS_INTERNAL_SCOPEDCONNECTION_H
te::pgis::ConnectionPool
This class implements a connection pool for the PostGIS driver.
Definition:
ConnectionPool.h:50
te::pgis::Connection
A class that implements a connection to a PostgreSQL database.
Definition:
Connection.h:69
te::pgis::ScopedConnection
A class that control the use of the connection to a PostgreSQL database.
Definition:
ScopedConnection.h:49
te::pgis::ScopedConnection::operator->
Connection * operator->() const
te::pgis::ScopedConnection::m_connectionPool
ConnectionPool * m_connectionPool
The connection pool associated to the connection.
Definition:
ScopedConnection.h:73
te::pgis::ScopedConnection::m_connection
Connection * m_connection
An available connection that will be released when the scopedConnection is deleted.
Definition:
ScopedConnection.h:72
te::pgis::ScopedConnection::release
void release()
Release connection.
te::pgis::ScopedConnection::ScopedConnection
ScopedConnection(const ScopedConnection &)
te::pgis::ScopedConnection::ScopedConnection
ScopedConnection(ConnectionPool *pool, int id=-1)
Constructor.
te::pgis::ScopedConnection::operator=
ScopedConnection & operator=(const ScopedConnection &)
te::pgis::ScopedConnection::~ScopedConnection
~ScopedConnection()
Destructor.
te
TerraLib.
Definition:
AddressGeocodingOp.h:52
TEPGISEXPORT
#define TEPGISEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition:
Config.h:195
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
git_release
src
terralib
postgis
ScopedConnection.h
Generated on Mon Jun 5 2023 10:44:31 for TerraLib by
1.9.1