00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PQXX_TRIGGER_H
00019 #define PQXX_TRIGGER_H
00020
00021 #include <string>
00022
00023
00024
00025
00026 namespace pqxx
00027 {
00028
00030
00048 class PQXX_LIBEXPORT trigger : public PGSTD::unary_function<int, void>
00049 {
00050
00051 public:
00053
00057 trigger(connection_base &C, const PGSTD::string &N) :
00058 m_Conn(C), m_Name(N) { m_Conn.AddTrigger(this); }
00059
00060 virtual ~trigger() { m_Conn.RemoveTrigger(this); }
00061
00062 PGSTD::string Name() const { return m_Name; }
00063
00065
00070 virtual void operator()(int be_pid) =0;
00071
00072 protected:
00073 connection_base &Conn() const throw () { return m_Conn; }
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