Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

trigger.hxx

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/trigger.hxx
00005  *
00006  *   DESCRIPTION
00007  *      definition of the pqxx::trigger functor interface.
00008  *   pqxx::trigger describes a database trigger to wait on, and what it does
00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/trigger instead.
00010  *
00011  * Copyright (c) 2001-2005, 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/libcompiler.h"
00020 
00021 #include "pqxx/connection_base"
00022 
00023 
00024 /* Methods tested in eg. self-test program test001 are marked with "//[t1]"
00025  */
00026 
00027 namespace pqxx
00028 {
00030 
00054 class PQXX_LIBEXPORT trigger : public PGSTD::unary_function<int, void>
00055 {
00056 public:
00058 
00062   trigger(connection_base &C, const PGSTD::string &N) :                 //[t4]
00063     m_Conn(C), m_Name(N) { m_Conn.AddTrigger(this); }
00064 
00065   virtual ~trigger() throw ()                                           //[t4]
00066   {
00067 #ifdef PQXX_QUIET_DESTRUCTORS
00068     internal::disable_noticer Quiet(Conn());
00069 #endif
00070     m_Conn.RemoveTrigger(this);
00071   }
00072 
00073   const PGSTD::string &name() const { return m_Name; }                  //[t4]
00074 
00076 
00081   virtual void operator()(int be_pid) =0;                               //[t4]
00082 
00083 
00084 #ifdef PQXX_DEPRECATED_HEADERS
00085 
00086   PGSTD::string Name() const { return name(); }
00087 #endif
00088 
00089 protected:
00090   connection_base &Conn() const throw () { return m_Conn; }             //[t23]
00091 
00092 private:
00093   connection_base &m_Conn;
00094   PGSTD::string m_Name;
00095 };
00096 
00097 }
00098 
00099 

Generated on Mon Oct 3 20:28:59 2005 for libpqxx by  doxygen 1.4.2