| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/errorhandler.h>
Public Types | |
| enum | KindOfError { PROGRAM_ERROR, ARGUMENT_ERROR, WARNING, NOIMPL } |
| enum | KindOfAction { DO_ABORT, DO_EXIT, DO_CONTINUE, THROW_EXCEPTION } |
| typedef void(* | Function )(int errortype, const char *expr, const char *file, int line, const char *text) |
Static Public Member Functions | |
| static Function | setHandler (int errortype, Function funct) |
| Sets a new function for the error handling of the given kind and returns the old one. | |
| static int | setAction (int errortype, int action) |
| Sets a action for the error handling of the given kind and returns the old one. | |
| static void | callHandler (int errortype, const char *expr, const char *file, int line) |
| This method executes the handler currently associated with the given kind of error. | |
| static std::ostream & | newErrorOutputStringStream () |
| static std::string | getLastError () |
| static void | enableErrorLogging (bool enable) |
| Enables/disables logging of all errors via VRS::Logger() By default this is turned off. | |
| typedef void(* VRS::ErrorHandler::Function)(int errortype, const char *expr, const char *file, int line, const char *text) |
Sets a new function for the error handling of the given kind and returns the old one.
| static int VRS::ErrorHandler::setAction | ( | int | errortype, | |
| int | action | |||
| ) | [static] |
Sets a action for the error handling of the given kind and returns the old one.
| static void VRS::ErrorHandler::callHandler | ( | int | errortype, | |
| const char * | expr, | |||
| const char * | file, | |||
| int | line | |||
| ) | [static] |
This method executes the handler currently associated with the given kind of error.
Based on the action defined, the method aborts, exits, continues or throws an exception. In general, this method is called by the error macros and not directly by the programmer.
| static std::ostream& VRS::ErrorHandler::newErrorOutputStringStream | ( | ) | [static] |
Returns an empty string stream into which an error message must be written before callHandler is invoked. The current content of the returned stream will be given to the handling function as text.
| static std::string VRS::ErrorHandler::getLastError | ( | ) | [static] |
On WIN32 systems returns the formatted error string which is associated with GetLastError(). On all other systems this method is not implemented yet!
| static void VRS::ErrorHandler::enableErrorLogging | ( | bool | enable | ) | [static] |
Enables/disables logging of all errors via VRS::Logger() By default this is turned off.