libpqxx 4.0
|
The ultimate template that defines a connection type. More...
#include <basic_connection.hxx>
Public Member Functions | |
basic_connection () | |
basic_connection (const std::string &opt) | |
basic_connection (const char opt[]) | |
~basic_connection () throw () | |
const std::string & | options () const throw () |
The ultimate template that defines a connection type.
Combines connection_base (the highly complex class implementing essentially all connection-related functionality) with a connection policy (a simpler helper class determining the rules that govern the process of setting up the underlying connection to the backend).
The pattern used to combine these classes is the same as for basic_transaction. Through use of the template mechanism, the policy object is embedded in the basic_connection object so that it does not need to be allocated separately. At the same time this construct avoids the need for any virtual functions in this class, which reduces risks of bugs in construction and destruction; as well as any need to templatize the larger body of code in the connection_base class which might otherwise lead to unacceptable code duplication.
pqxx::basic_connection< CONNECTPOLICY >::basic_connection | ( | ) |
References pqxx::connection_base::init().
pqxx::basic_connection< CONNECTPOLICY >::basic_connection | ( | const std::string & | opt | ) | [explicit] |
References pqxx::connection_base::init().
pqxx::basic_connection< CONNECTPOLICY >::basic_connection | ( | const char | opt[] | ) | [explicit] |
References pqxx::connection_base::init().
pqxx::basic_connection< CONNECTPOLICY >::~basic_connection | ( | ) | throw () |
References pqxx::connection_base::close().
const std::string& pqxx::basic_connection< CONNECTPOLICY >::options | ( | ) | const throw () |