00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pqxx/compiler-public.hxx"
00020 #include "pqxx/compiler-internal-pre.hxx"
00021
00022 #include "pqxx/connection_base"
00023
00024
00025
00026
00027
00028 namespace pqxx
00029 {
00031
00056 class PQXX_LIBEXPORT trigger : public PGSTD::unary_function<int, void>
00057 {
00058 public:
00060
00064 trigger(connection_base &C, const PGSTD::string &N) :
00065 m_Conn(C), m_Name(N) { m_Conn.AddTrigger(this); }
00066
00067 virtual ~trigger() throw ()
00068 {
00069 #ifdef PQXX_QUIET_DESTRUCTORS
00070 internal::disable_noticer Quiet(Conn());
00071 #endif
00072 m_Conn.RemoveTrigger(this);
00073 }
00074
00075 const PGSTD::string &name() const { return m_Name; }
00076
00078
00083 virtual void operator()(int be_pid) =0;
00084
00085
00086 #ifdef PQXX_DEPRECATED_HEADERS
00088 PGSTD::string Name() const PQXX_DEPRECATED { return name(); }
00089 #endif
00090
00091 protected:
00092 connection_base &Conn() const throw () { return m_Conn; }
00093
00094 private:
00096 trigger(const trigger &);
00098 trigger &operator=(const trigger &);
00099
00100 connection_base &m_Conn;
00101 PGSTD::string m_Name;
00102 };
00103
00104 }
00105
00106
00107 #include "pqxx/compiler-internal-post.hxx"