mysql_cli::Events Class Reference

MySQL connection events class. More...

#include <conn.h>

List of all members.

Public Types

enum  {
  evConnected = 1, evPing = 2, evClosed = 3, evError = 4,
  evQuery = 5, evWarningNote = 6, evWarning = 7, evWarningError = 8
}
 Log events. More...

Public Member Functions

virtual ~Events ()
 Destructor.
virtual Eventscopy () const =0
 Makes a copy of the object.
virtual void log_event (Conn &conn, int event, unsigned int code, char const *msg) const =0
 Logs an event.


Detailed Description

This class is used by the Conn class as an event notifier. It must be inherited in another class and the log_event() function must be overriden. Then, Conn::events() must be called to register the event notifier.

Member Enumeration Documentation

anonymous enum

Enumerator:
evConnected  Connected to the MySQL database.
evPing  Successful ping.
evClosed  Connection closed.
evError  Connection error.
evQuery  An executed query.
evWarningNote  Warning: note level.
evWarning  Warning: warning level.
evWarningError  Warning: error level.


Member Function Documentation

virtual Events* mysql_cli::Events::copy (  )  const [pure virtual]

Makes a copy of the object. This is called by Conn's copy constructor and assignment operator.

Returns:
A copy of the object.

virtual void mysql_cli::Events::log_event ( Conn conn,
int  event,
unsigned int  code,
char const *  msg 
) const [pure virtual]

Logs an event.

Parameters:
[in] conn The connection where the event happened.
[in] event Can be one of the following values: evConnected, evClosed, evError, evQuery, evWarningNote, evWarning or evWarningError.
[in] code For evWarningNote, evWarning and evWarningError, the corresponding warning code.
[in] msg A message associated to the event, if any. For evError events, it is the context of the error, for evQuery it is the query that has been executed, and for evWarningNote, evWarning and evWarningError, the contents of the warnings.


The documentation for this class was generated from the following file:
Generated on Fri Apr 18 22:03:28 2008 for Epona API by  doxygen 1.5.3