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

Base class for error-handler callbacks. More...

#include <errorhandler.hxx>

Inheritance diagram for pqxx::errorhandler:
Collaboration diagram for pqxx::errorhandler:

Public Member Functions

 errorhandler (connection_base &)
 
virtual ~errorhandler ()
 
virtual bool operator() (const char msg[])=0 throw ()
 Define in subclass: receive an error or warning message from the database. More...
 

Private Member Functions

 errorhandler ()
 
 errorhandler (const errorhandler &)
 
errorhandleroperator= (const errorhandler &)
 
void unregister () throw ()
 

Private Attributes

connection_basem_home
 

Friends

class internal::gate::errorhandler_connection_base
 

Detailed Description

Base class for error-handler callbacks.

To receive errors and warnings from a connection, subclass this with your own error-handler functor, and instantiate it for the connection. Destroying the handler un-registers it.

A connection can have multiple error handlers at the same time. When the database connection emits an error or warning message, it passes the message to each error handler, starting with the most recently registered one and progressing towards the oldest one. However an error handler may also instruct the connection not to pass the message to further handlers by returning "false."

Constructor & Destructor Documentation

pqxx::errorhandler::errorhandler ( connection_base )
explicit
virtual pqxx::errorhandler::~errorhandler ( )
virtual
pqxx::errorhandler::errorhandler ( )
private
pqxx::errorhandler::errorhandler ( const errorhandler )
private

Member Function Documentation

virtual bool pqxx::errorhandler::operator() ( const char  msg[]) throw ()
pure virtual

Define in subclass: receive an error or warning message from the database.

Returns
Whether the same error message should also be passed to the remaining, older errorhandlers.

Implemented in pqxx::quiet_errorhandler.

errorhandler& pqxx::errorhandler::operator= ( const errorhandler )
private
void pqxx::errorhandler::unregister ( ) throw ()
private

Friends And Related Function Documentation

Member Data Documentation

connection_base* pqxx::errorhandler::m_home
private

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