notification.hxx
/*-------------------------------------------------------------------------
*
* FILE
* pqxx/notification.hxx
*
* DESCRIPTION
* definition of the pqxx::notification_receiver functor interface.
* pqxx::notification_receiver handles incoming notifications.
* DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/notification instead.
*
* Copyright (c) 2011, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this mistake,
* or contact the author.
*
*-------------------------------------------------------------------------
*/
#ifndef PQXX_H_NOTIFICATION
#define PQXX_H_NOTIFICATION
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
namespace pqxx
{
class connection_base;
class PQXX_LIBEXPORT PQXX_NOVTABLE notification_receiver :
public PGSTD::binary_function<const PGSTD::string &, int, void>
{
public:
notification_receiver(connection_base &c, const PGSTD::string &channel);
virtual ~notification_receiver();
const PGSTD::string &channel() const { return m_channel; }
virtual void operator()(const PGSTD::string &payload, int backend_pid) =0;
protected:
connection_base &conn() const throw () { return m_conn; }
private:
// Not allowed.
notification_receiver(const notification_receiver &);
// Not allowed.
notification_receiver &operator=(const notification_receiver &);
connection_base &m_conn;
PGSTD::string m_channel;
};
}
#include "pqxx/compiler-internal-pre.hxx"
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::connection_base
connection_base abstract base class; represents a connection to a database.
Definition: connection_base.hxx:151
pqxx::notification_receiver::channel
const std::string & channel() const
The channel that this receiver listens on.
Definition: notification.hxx:72
pqxx::notification_receiver
Definition: notification.hxx:59
pqxx::notification_receiver::conn
connection_base & conn() const
Definition: notification.hxx:85
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: basic_connection.hxx:35