Public Member Functions | Static Public Member Functions

Celartem::Exception Class Reference

#include <cel_exception.h>

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

List of all members.

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:
inError An error code defined in GeneralErrorDefinition.
inErrorDesc A string that represents the details of the error status.
inFileName A filename of the source file that contains the caller. Usually, you should set __FILE__ macro.
inLine A line number in the source file that contains the caller. Usually, you should set __LINE__ macro.
inFuncName The 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:
inError An error code defined in GeneralErrorDefinition.
inErrorDesc A string that represents the details of the error status.
inFileName A filename of the source file that contains the caller. Usually, you should set __FILE__ macro.
inLine A line number in the source file that contains the caller. Usually, you should set __LINE__ macro.
inFuncName The 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:
inException An 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:
inException An 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:
onExcepionCallback Callback 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:

This document is made with doxygen 1.7.1 at Sun Sep 5 2010 13:03:37.
Caminova Logo