# connectionpolicy.hxx

Go to the documentation of this file.

    00001 /*-------------------------------------------------------------------------
    00002  *
    00003  *   FILE
    00004  *      pqxx/connectionpolicy.hxx
    00005  *
    00006  *   DESCRIPTION
    00007  *      definition of the connection policy classes
    00008  *   Interface for defining connection policies
    00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/connection instead.
    00010  *
    00011  * Copyright (c) 2005-2006, Jeroen T. Vermeulen <jtv@xs4all.nl>
    00012  *
    00013  * See COPYING for copyright license.  If you did not receive a file called
    00014  * COPYING with this source code, please notify the distributor of this mistake,
    00015  * or contact the author.
    00016  *
    00017  *-------------------------------------------------------------------------
    00018  */
    00019 #include "pqxx/compiler-public.hxx"
    00020 #include "pqxx/compiler-internal-pre.hxx"
    00021
    00022 #include <string>
    00023
    00024 #include "pqxx/libpq-forward.hxx"
    00025
    00026
    00027 namespace pqxx
    00028 {
    00029
    00030
    00035
    00036 class PQXX_LIBEXPORT connectionpolicy
    00037 {
    00038 public:
    00039   typedef internal::pq::PGconn *handle;
    00040
    00041   explicit connectionpolicy(const PGSTD::string &opts);
    00042   virtual ~connectionpolicy() throw ();
    00043
    00044   const PGSTD::string &options() const throw () { return m_options; }
    00045
    00046   virtual handle do_startconnect(handle orig);
    00047   virtual handle do_completeconnect(handle orig);
    00048   virtual handle do_dropconnect(handle orig) throw ();
    00049   virtual handle do_disconnect(handle orig) throw ();
    00050   virtual bool is_ready(handle) const throw ();
    00051
    00052 protected:
    00053   handle normalconnect(handle);
    00054
    00055 private:
    00056   PGSTD::string m_options;
    00057 };
    00058
    00060 } // namespace
    00061
    00062 #include "pqxx/compiler-internal-post.hxx"