libpqxx: pqxx::notification_receiver Class Reference

libpqxx 4.0.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | List of all members
pqxx::notification_receiver Class Reference

`#include <notification.hxx>`

Inheritance diagram for pqxx::notification_receiver:

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

## Protected Member Functions
connection_base & | conn () const throw ()

## Constructor & Destructor Documentation

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

Register the receiver with a connection.

Parameters

  c | Connnection to operate on.
  channel | Name of the notification to listen for.

pqxx::notification_receiver::~notification_receiver | ( |  | ) |
| virtual

## Member Function Documentation

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

The channel that this receiver listens on.

connection_base& pqxx::notification_receiver::conn | ( |  | ) | const throw ()
| protected

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

Overridable: action to invoke when notification arrives.

Parameters

  payload | On PostgreSQL 9.0 or later, an optional string that may have been passed to the NOTIFY command.
  backend_pid | Process 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.

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

- notification.hxx
- notification.cxx