notification.hxx
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PQXX_H_NOTIFICATION
00020 #define PQXX_H_NOTIFICATION
00021
00022 #include "pqxx/compiler-public.hxx"
00023 #include "pqxx/compiler-internal-pre.hxx"
00024
00025 namespace pqxx
00026 {
00027 class connection_base;
00028
00029
00031
00059 class PQXX_LIBEXPORT PQXX_NOVTABLE notification_receiver :
00060 public std::binary_function<const std::string &, int, void>
00061 {
00062 public:
00064
00068 notification_receiver(connection_base &c, const std::string &channel);
00069 virtual ~notification_receiver();
00070
00072 const std::string &channel() const { return m_channel; }
00073
00075
00082 virtual void operator()(const std::string &payload, int backend_pid) =0;
00083
00084 protected:
00085 connection_base &conn() const PQXX_NOEXCEPT { return m_conn; }
00086
00087 private:
00088
00089 notification_receiver(const notification_receiver &);
00090
00091 notification_receiver &operator=(const notification_receiver &);
00092
00093 connection_base &m_conn;
00094 std::string m_channel;
00095 };
00096 }
00097
00098 #include "pqxx/compiler-internal-post.hxx"
00099 #endif