Public Member Functions | Static Public Member Functions | List of all members
Celartem::Exception Class Reference

#include <cel_exception.h>

Inheritance diagram for Celartem::Exception:
Inheritance graph
[legend]

Public Member Functions

 Exception (GeneralErrorDefinition inError, const char *inErrorDesc, const char *inFileName, int inLine, const char *inFuncName="")
 
 Exception (GeneralErrorDefinition inError, const String &inErrorDesc, const char *inFileName, int inLine, const char *inFuncName="")
 
 Exception (const Exception &inException)
 
Exceptionoperator= (const Exception &inException)
 
GeneralErrorDefinition getError () const
 
String getMessage () const
 
virtual const char * what () const throw ()
 

Static Public Member Functions

static void setOnExceptionCallback (void(*onExcepionCallback)(const Exception &))
 

Detailed Description

Exception class defines the base class for the exceptions used in this library. Although you can explicitly throw instances of this class, you should use celThrow or celThrow2 to throw exceptions.

See Also
Exception Handling, celThrow, celThrow2, GeneralErrorDefinition

Constructor & Destructor Documentation

Celartem::Exception::Exception ( GeneralErrorDefinition  inError,
const char *  inErrorDesc,
const char *  inFileName,
int  inLine,
const char *  inFuncName = "" 
)

Create a new Exception. This constructor should not be called directly, you had better use celThrow, celThrow2 macros.

Parameters
inErrorAn error code defined in GeneralErrorDefinition.
inErrorDescA string that represents the details of the error status.
inFileNameA filename of the source file that contains the caller. Usually, you should set FILE macro.
inLineA line number in the source file that contains the caller. Usually, you should set LINE macro.
inFuncNameThe name of the function that throws this exception. You can set FUNCTION macro for this parameter.
See Also
celThrow, celThrow2
Celartem::Exception::Exception ( GeneralErrorDefinition  inError,
const String inErrorDesc,
const char *  inFileName,
int  inLine,
const char *  inFuncName = "" 
)

Create a new Exception. This constructor should not be called directly, you had better use celThrow, celThrow2 macros.

Parameters
inErrorAn error code defined in GeneralErrorDefinition.
inErrorDescA string that represents the details of the error status.
inFileNameA filename of the source file that contains the caller. Usually, you should set FILE macro.
inLineA line number in the source file that contains the caller. Usually, you should set LINE macro.
inFuncNameThe name of the function that throws this exception. You can set FUNCTION macro for this parameter.
See Also
celThrow, celThrow2
Celartem::Exception::Exception ( const Exception inException)

Duplicate the exception.

Parameters
inExceptionAn Exception instance to duplicate.

Member Function Documentation

GeneralErrorDefinition Celartem::Exception::getError ( ) const

Gets the error code.

Returns
An error code. This is usually one of GeneralErrorDefinition enumeration values but you should not assume the code is in them.
See Also
GeneralErrorDefinition, celThrow, celThrow2
String Celartem::Exception::getMessage ( ) const

Get the error message.

Returns
Error string. This is almost same to what method but it is in String instance.
Exception& Celartem::Exception::operator= ( const Exception inException)

Duplicate the exception.

Parameters
inExceptionAn Exception instance to duplicate.
static void Celartem::Exception::setOnExceptionCallback ( void(*)(const Exception &)  onExcepionCallback)
static

Set callback function, which is called when any of Exception instance is created.

Parameters
onExcepionCallbackCallback function or NULL to disable callback.
virtual const char* Celartem::Exception::what ( ) const
throw (
)
virtual

Get the error message.

Returns
Error string.

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo