pqxx::notification_receiver Class Referenceabstract

#include <notification.hxx>

Public Member Functions

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

Protected Member Functions

connection_baseconn () const noexcept

Constructor & Destructor Documentation

◆ notification_receiver() [1/2]

pqxx::notification_receiver::notification_receiver ( connection_base c,
const std::string &  channel 

Register the receiver with a connection.

cConnnection to operate on.
channelName of the notification to listen for.

◆ notification_receiver() [2/2]

pqxx::notification_receiver::notification_receiver ( const notification_receiver )

◆ ~notification_receiver()

pqxx::notification_receiver::~notification_receiver ( )

References conn().

Member Function Documentation

◆ channel()

const std::string& pqxx::notification_receiver::channel ( ) const

The channel that this receiver listens on.

Referenced by pqxx::connection_base::trace().

◆ conn()

connection_base& pqxx::notification_receiver::conn ( ) const

Referenced by ~notification_receiver().

◆ operator()()

virtual void pqxx::notification_receiver::operator() ( const std::string &  payload,
int  backend_pid 
pure virtual

Overridable: action to invoke when notification arrives.

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.

◆ operator=()

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

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