00001 /*------------------------------------------------------------------------- 00002 * 00003 * FILE 00004 * pqxx/notify-listen.hxx 00005 * 00006 * DESCRIPTION 00007 * definition of the pqxx::notify_listener functor interface. 00008 * pqxx::notify_listener describes a notification to wait on, and what it does 00009 * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/notify-listen instead. 00010 * 00011 * Copyright (c) 2001-2008, Jeroen T. Vermeulen <jtv@xs4all.nl> 00012 * 00013 * See COPYING for copyright license. If you did not receive a file called 00014 * COPYING with this source code, please notify the distributor of this mistake, 00015 * or contact the author. 00016 * 00017 *------------------------------------------------------------------------- 00018 */ 00019 #ifndef PQXX_H_NOTIFY_LISTEN 00020 #define PQXX_H_NOTIFY_LISTEN 00021 00022 #include "pqxx/compiler-public.hxx" 00023 #include "pqxx/compiler-internal-pre.hxx" 00024 00025 #include "pqxx/connection_base" 00026 00027 00028 /* Methods tested in eg. self-test program test001 are marked with "//[t1]" 00029 */ 00030 00031 namespace pqxx 00032 { 00034 00059 class PQXX_LIBEXPORT PQXX_NOVTABLE notify_listener : 00060 public PGSTD::unary_function<int, void> 00061 { 00062 public: 00064 00068 notify_listener(connection_base &C, const PGSTD::string &N); //[t4] 00069 00070 virtual ~notify_listener() throw (); //[t4] 00071 00072 const PGSTD::string &name() const { return m_Name; } //[t4] 00073 00075 00080 virtual void operator()(int be_pid) =0; //[t4] 00081 00082 00083 protected: 00085 connection_base &Conn() const throw () { return conn(); } //[t23] 00086 00088 connection_base &conn() const throw () { return m_conn; } //[t23] 00089 00090 private: 00092 notify_listener(const notify_listener &); 00094 notify_listener &operator=(const notify_listener &); 00095 00096 connection_base &m_conn; 00097 PGSTD::string m_Name; 00098 }; 00099 00100 } 00101 00102 00103 #include "pqxx/compiler-internal-post.hxx" 00104 00105 #endif