CppDB
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions
cppdb::pool Class Reference

Connections pool, allows to handle multiple connections for specific connection string. More...

#include <cppdb/pool.h>

Inheritance diagram for cppdb::pool:
cppdb::ref_counted

List of all members.

Classes

struct  entry

Public Types

typedef ref_ptr< poolpointer

Public Member Functions

ref_ptr< backend::connectionopen ()
void gc ()
void clear ()

Static Public Member Functions

static ref_ptr< poolcreate (std::string const &connection_string)
 Create new pool for connection_string.
static ref_ptr< poolcreate (connection_info const &ci)
 Create new pool for a parsed connection string ci.

Detailed Description

Connections pool, allows to handle multiple connections for specific connection string.

Note connections_manager provide more generic interface and hides pools inside it. So you generally should use this class only when you prefer to avoid using some global singleton object.

Unlike connections_manager, it uses pool by default unless its size defined as 0.

All this class member functions are thread safe to use from several threads for the same object


Member Typedef Documentation

Shortcut of cppdb::ref_ptr<cppdb::pool> as cppdb::pool::pointer.

The pointer that is used to handle pool object


Member Function Documentation

Remove all connections from the pool

void cppdb::pool::gc ( )

Collect connections that were not used for a long time (close them)

Get a open a connection, it may be fetched either from pool or new one may be created


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator