notification.hxx
#ifndef PQXX_H_NOTIFICATION
#define PQXX_H_NOTIFICATION
#include "pqxx/compiler-public.hxx"
#include "pqxx/compiler-internal-pre.hxx"
#include <string>
#include "pqxx/types.hxx"
namespace pqxx
{
class PQXX_LIBEXPORT PQXX_NOVTABLE notification_receiver
{
public:
notification_receiver(connection_base &c, const std::string &channel);
notification_receiver(const notification_receiver &) =delete;
notification_receiver &operator=(const notification_receiver &) =delete;
virtual ~notification_receiver();
const std::string &channel() const { return m_channel; }
virtual void operator()(const std::string &payload, int backend_pid) =0;
protected:
connection_base &conn() const noexcept { return m_conn; }
private:
connection_base &m_conn;
std::string m_channel;
};
}
#include "pqxx/compiler-internal-post.hxx"
#endif
pqxx::internal
Private namespace for libpqxx's internal use; do not access.
Definition: connection_base.hxx:43
pqxx::notification_receiver::channel
const std::string & channel() const
The channel that this receiver listens on.
Definition: notification.hxx:69
pqxx::notification_receiver
Definition: notification.hxx:55
pqxx::notification_receiver::conn
connection_base & conn() const noexcept
Definition: notification.hxx:82
pqxx::notification_receiver::notification_receiver
notification_receiver(connection_base &c, const std::string &channel)
Register the receiver with a connection.
Definition: notification.cxx:23
pqxx::connection_base
connection_base abstract base class; represents a connection to a database.
Definition: connection_base.hxx:139
pqxx::notification_receiver::~notification_receiver
virtual ~notification_receiver()
Definition: notification.cxx:33
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25