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  *-------------------------------------------------------------------------
00013  */
00014 #ifndef PQXX_TRIGGER_H
00015 #define PQXX_TRIGGER_H
00016 
00017 #include <string>
00018 
00019 /* Methods tested in eg. self-test program test1 are marked with "//[t1]"
00020  */
00021 
00022 namespace pqxx
00023 {
00024 
00026 
00044 class PQXX_LIBEXPORT Trigger
00045 {
00046 public:
00048 
00052   Trigger(Connection &C, const PGSTD::string &N) :                      //[t4]
00053     m_Conn(C), m_Name(N) { m_Conn.AddTrigger(this); }
00054 
00055   virtual ~Trigger() { m_Conn.RemoveTrigger(this); }                    //[t4]
00056 
00057   PGSTD::string Name() const { return m_Name; }                         //[t4]
00058 
00060 
00065   virtual void operator()(int be_pid) =0;                               //[t4]
00066 
00067 protected:
00068   Connection &Conn() const throw () { return m_Conn; }                  //[t4]
00069 
00070 private:
00071   Connection &m_Conn;
00072   PGSTD::string m_Name;
00073 };
00074 
00075 }
00076 
00077 
00078 #endif
00079 

Generated on Fri Feb 28 19:23:32 2003 for libpqxx by doxygen1.3-rc3