libpqxx  v4.0-1
C++ library for PostgreSQL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pqxx::connect_direct Class Reference

Connection policy; creates an immediate connection to a database. More...

#include <connection.hxx>

Inheritance diagram for pqxx::connect_direct:
Collaboration diagram for pqxx::connect_direct:

Public Types

typedef internal::pq::PGconnhandle
 

Public Member Functions

 connect_direct (const PGSTD::string &opts)
 
virtual handle do_completeconnect (handle orig)
 
virtual handle do_disconnect (handle orig) throw ()
 
virtual handle do_dropconnect (handle orig) throw ()
 
virtual handle do_startconnect (handle)
 
virtual bool is_ready (handle) const throw ()
 
const PGSTD::string & options () const throw ()
 

Protected Member Functions

handle normalconnect (handle)
 

Detailed Description

Connection policy; creates an immediate connection to a database.

This is the policy you typically need when you work with a database through libpqxx. It connects to the database immediately. Another option is to defer setting up the underlying connection to the database until it's actually needed; the connect_lazy policy implements such "lazy" * behaviour.

The advantage of having an "immediate" connection (as this policy gives you) is that any errors in setting up the connection will occur during construction of the connection object, rather than at some later point further down your program.

Member Typedef Documentation

Constructor & Destructor Documentation

pqxx::connect_direct::connect_direct ( const PGSTD::string &  opts)
inlineexplicit

Member Function Documentation

virtual handle pqxx::connectionpolicy::do_completeconnect ( handle  orig)
virtualinherited

Reimplemented in pqxx::connect_async, and pqxx::connect_lazy.

virtual handle pqxx::connectionpolicy::do_disconnect ( handle  orig) throw ()
virtualinherited
virtual handle pqxx::connectionpolicy::do_dropconnect ( handle  orig) throw ()
virtualinherited

Reimplemented in pqxx::connect_async.

virtual handle pqxx::connect_direct::do_startconnect ( handle  )
virtual

Reimplemented from pqxx::connectionpolicy.

virtual bool pqxx::connectionpolicy::is_ready ( handle  ) const throw ()
virtualinherited

Reimplemented in pqxx::connect_async.

handle pqxx::connectionpolicy::normalconnect ( handle  )
protectedinherited
const PGSTD::string& pqxx::connectionpolicy::options ( ) const throw ()
inlineinherited

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