# pqxx::basic_connection< CONNECTPOLICY > Class Template Reference

The ultimate template that defines a connection type. More...

`#include <basic_connection.hxx>`

Inheritance diagram for pqxx::basic_connection< CONNECTPOLICY >:

[legend]

List of all members.

## 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 ()

## Detailed Description

### template<typename CONNECTPOLICY>
class pqxx::basic_connection< CONNECTPOLICY >

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.

## Constructor & Destructor Documentation

template<typename CONNECTPOLICY >

pqxx::basic_connection< CONNECTPOLICY >::basic_connection | ( |  | ) |

References pqxx::connection_base::init().

template<typename CONNECTPOLICY >

pqxx::basic_connection< CONNECTPOLICY >::basic_connection | ( | const std::string & | opt | ) | `[explicit]`

References pqxx::connection_base::init().

template<typename CONNECTPOLICY >

pqxx::basic_connection< CONNECTPOLICY >::basic_connection | ( | const char | opt[] | ) | `[explicit]`

References pqxx::connection_base::init().

template<typename CONNECTPOLICY >

pqxx::basic_connection< CONNECTPOLICY >::~basic_connection | ( |  | ) | throw ()

References pqxx::connection_base::close(), and pqxx::connection_base::set_noticer().

## Member Function Documentation

template<typename CONNECTPOLICY >

const std ::string& pqxx::basic_connection< CONNECTPOLICY >::options | ( |  | ) | const throw ()

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

- basic_connection.hxx