libpqxx  v4.0-1
C++ library for PostgreSQL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pqxx::notification_receiver Class Referenceabstract

#include <notification.hxx>

Inheritance diagram for pqxx::notification_receiver:
Collaboration diagram for pqxx::notification_receiver:

Public Member Functions

 notification_receiver (connection_base &c, const PGSTD::string &channel)
 Register the receiver with a connection. More...
 
virtual ~notification_receiver ()
 
const PGSTD::string & channel () const
 The channel that this receiver listens on. More...
 
virtual void operator() (const PGSTD::string &payload, int backend_pid)=0
 Overridable: action to invoke when notification arrives. More...
 

Protected Member Functions

connection_baseconn () const throw ()
 

Private Member Functions

 notification_receiver (const notification_receiver &)
 
notification_receiveroperator= (const notification_receiver &)
 

Private Attributes

PGSTD::string m_channel
 
connection_basem_conn
 

Constructor & Destructor Documentation

pqxx::notification_receiver::notification_receiver ( connection_base c,
const PGSTD::string &  channel 
)

Register the receiver with a connection.

Parameters
cConnnection to operate on.
channelName of the notification to listen for.
virtual pqxx::notification_receiver::~notification_receiver ( )
virtual
pqxx::notification_receiver::notification_receiver ( const notification_receiver )
private

Member Function Documentation

const PGSTD::string& pqxx::notification_receiver::channel ( ) const
inline

The channel that this receiver listens on.

connection_base& pqxx::notification_receiver::conn ( ) const throw ()
inlineprotected
virtual void pqxx::notification_receiver::operator() ( const PGSTD::string &  payload,
int  backend_pid 
)
pure virtual

Overridable: action to invoke when notification arrives.

Parameters
payloadOn PostgreSQL 9.0 or later, an optional string that may have been passed to the NOTIFY command.
backend_pidProcess ID of the database backend process that served our connection when the notification arrived. The actual process ID behind the connection may have changed by the time this method is called.

Implemented in pqxx::internal::notify_listener_forwarder.

notification_receiver& pqxx::notification_receiver::operator= ( const notification_receiver )
private

Member Data Documentation

PGSTD::string pqxx::notification_receiver::m_channel
private
connection_base& pqxx::notification_receiver::m_conn
private

The documentation for this class was generated from the following file: