00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #include "pqxx/libcompiler.h"
00020 
00021 #include "pqxx/connection_base"
00022 
00023 
00024 
00025 
00026 
00027 namespace pqxx
00028 {
00030 
00048 class PQXX_LIBEXPORT trigger : public PGSTD::unary_function<int, void>
00049 {
00050 public:
00052 
00056   trigger(connection_base &C, const PGSTD::string &N) :                 
00057     m_Conn(C), m_Name(N) { m_Conn.AddTrigger(this); }
00058 
00059   virtual ~trigger() throw ()                                           
00060   {
00061 #ifdef PQXX_QUIET_DESTRUCTORS
00062     internal::disable_noticer Quiet(Conn());
00063 #endif
00064     m_Conn.RemoveTrigger(this);
00065   }
00066 
00067   const PGSTD::string &name() const { return m_Name; }                  
00068 
00070 
00075   virtual void operator()(int be_pid) =0;                               
00076 
00077 
00078 #ifdef PQXX_DEPRECATED_HEADERS
00079 
00080   PGSTD::string Name() const { return name(); }
00081 #endif
00082 
00083 protected:
00084   connection_base &Conn() const throw () { return m_Conn; }             
00085 
00086 private:
00087   connection_base &m_Conn;
00088   PGSTD::string m_Name;
00089 };
00090 
00091 }
00092 
00093