Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

trigger.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  *   FILE
00004  *      pqxx/trigger.h
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  *
00010  * Copyright (c) 2001-2003, Jeroen T. Vermeulen <jtv@xs4all.nl>
00011  *
00012  * See COPYING for copyright license.  If you did not receive a file called
00013  * COPYING with this source code, please notify the distributor of this mistake,
00014  * or contact the author.
00015  *
00016  *-------------------------------------------------------------------------
00017  */
00018 #ifndef PQXX_TRIGGER_H
00019 #define PQXX_TRIGGER_H
00020 
00021 #include <string>
00022 
00023 /* Methods tested in eg. self-test program test1 are marked with "//[t1]"
00024  */
00025 
00026 namespace pqxx
00027 {
00028 
00030 
00048 class PQXX_LIBEXPORT trigger : public PGSTD::unary_function<int, void>
00049 {
00050   // TODO: Rename to trigger
00051 public:
00053 
00057   trigger(connection_base &C, const PGSTD::string &N) :                 //[t4]
00058     m_Conn(C), m_Name(N) { m_Conn.AddTrigger(this); }
00059 
00060   virtual ~trigger() { m_Conn.RemoveTrigger(this); }                    //[t4]
00061 
00062   PGSTD::string Name() const { return m_Name; }                         //[t4]
00063 
00065 
00070   virtual void operator()(int be_pid) =0;                               //[t4]
00071 
00072 protected:
00073   connection_base &Conn() const throw () { return m_Conn; }             //[t23]
00074 
00075 private:
00076   connection_base &m_Conn;
00077   PGSTD::string m_Name;
00078 };
00079 
00081 typedef trigger Trigger;
00082 
00083 }
00084 
00085 
00086 #endif
00087 

Generated on Sat Jun 7 00:49:34 2003 for libpqxx by doxygen1.3-rc3