Made to Order Software Corporation Logo

libsswf: sswf::ErrorManager::ErrorHandler Class Reference

A sub-class to derive from to receive errors. More...

#include <libsswf.h>

List of all members.

Public Member Functions

virtual error_code_t OnError (error_code_t errcode, const char *msg)=0
 Function to overload to catch errors.
virtual ~ErrorHandler ()
 A destructor since the class has a virtual function.

Detailed Description

This class is used to catch the errors generated by the library through the error manager. You can setup one error handler pointer in the library. It is called each time there is an error letting you application deal with how to display the error to the end user. By default, the library prints the error on stderr.

See also:
sswf::ErrorManager::ErrorHandler::OnError(error_code_t errcode, const char *msg) = 0

Constructor & Destructor Documentation

ErrorManager::ErrorHandler::~ErrorHandler (  )  [virtual]

This destructor ensures that all the destructors from classes derived from this class are called as expected.

Member Function Documentation

sswf::ErrorManager::ErrorHandler::OnError ( error_code_t  errcode,
const char *  msg 
) [pure virtual]

To catch the errors, derive from the ErrorHandler sub-class and implement this function. It receives the error code and a message one can print on the screen.

[in] errcode The code of the error being generated
[in] msg The message corresponding to the specified errcode
The function is expected to return errcode, but if you want the library to ignore the error, you can instead return ERROR_CODE_NONE. In this case, some functions will still fail and ignore that return code.

Referenced by sswf::ErrorManager::OnError().

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

Generated on Wed Mar 18 15:13:58 2009 for libsswf by  doxygen 1.5.5