EpcTools
An event based multi-threaded C++ development framework.
Classes | Macros
eerror.h File Reference

Defines base class for exceptions and declaration helper macros. More...

#include <exception>
#include "estring.h"

Go to the source code of this file.

Classes

class  EError
 The base class for exceptions derived from std::exception. More...
 

Macros

#define DECLARE_ERR_MAP(__name__)   EErrorMapEntry __name__[];
 
#define BGN_ERR_MAP(__name__)   EErrorMapEntry __name__[] = {
 Starts the definition of the error map in the code. More...
 
#define ERR_MAP_ENTRY(id, err)   {id, err},
 Adds an error map entry. More...
 
#define END_ERR_MAP()
 Ends (closes) the error map definition. More...
 
#define DECLARE_ERROR(__e__)
 Declares exception class derived from EError with no constructor parameters. More...
 
#define DECLARE_ERROR_ADVANCED(__e__)
 Declares exception class derived from EError with no constructor parameters and developer defined constructor body. More...
 
#define DECLARE_ERROR_ADVANCED2(__e__)
 Declares exception class derived from EError with an Int as a constructor parameter and developer defined constructor body. More...
 
#define DECLARE_ERROR_ADVANCED3(__e__)
 Declares exception class derived from EError with an Int and a const char * as constructor parameters and developer defined constructor body. More...
 
#define DECLARE_ERROR_ADVANCED4(__e__)
 Declares exception class derived from EError with an const char* as a constructor parameter and developer defined constructor body. More...
 

Detailed Description

Defines base class for exceptions and declaration helper macros.

Macro Definition Documentation

◆ BGN_ERR_MAP

#define BGN_ERR_MAP (   __name__)    EErrorMapEntry __name__[] = {

Starts the definition of the error map in the code.

◆ DECLARE_ERR_MAP

#define DECLARE_ERR_MAP (   __name__)    EErrorMapEntry __name__[];

Declares the error map in the EError derived object. The error map is used in conjunction with the static cpStr EError::getError() method to return a description of an application specific error code.

◆ DECLARE_ERROR

#define DECLARE_ERROR (   __e__)
Value:
class __e__ : public EError \
{ \
virtual const cpStr Name() const { return #__e__; } \
}

Declares exception class derived from EError with no constructor parameters.

◆ DECLARE_ERROR_ADVANCED

#define DECLARE_ERROR_ADVANCED (   __e__)
Value:
class __e__ : public EError \
{ \
public: \
__e__(); \
virtual const cpStr Name() const { return #__e__; } \
}

Declares exception class derived from EError with no constructor parameters and developer defined constructor body.

◆ DECLARE_ERROR_ADVANCED2

#define DECLARE_ERROR_ADVANCED2 (   __e__)
Value:
class __e__ : public EError \
{ \
public: \
__e__(Int err); \
virtual const cpStr Name() const { return #__e__; } \
}

Declares exception class derived from EError with an Int as a constructor parameter and developer defined constructor body.

◆ DECLARE_ERROR_ADVANCED3

#define DECLARE_ERROR_ADVANCED3 (   __e__)
Value:
class __e__ : public EError \
{ \
public: \
__e__(Int err, cpChar msg); \
virtual const cpStr Name() const { return #__e__; } \
}

Declares exception class derived from EError with an Int and a const char * as constructor parameters and developer defined constructor body.

◆ DECLARE_ERROR_ADVANCED4

#define DECLARE_ERROR_ADVANCED4 (   __e__)
Value:
class __e__ : public EError \
{ \
public: \
__e__(cpStr msg); \
virtual const cpStr Name() const { return #__e__; } \
}

Declares exception class derived from EError with an const char* as a constructor parameter and developer defined constructor body.

◆ END_ERR_MAP

#define END_ERR_MAP ( )
Value:
{ \
0, NULL \
} \
} \
;

Ends (closes) the error map definition.

◆ ERR_MAP_ENTRY

#define ERR_MAP_ENTRY (   id,
  err 
)    {id, err},

Adds an error map entry.

EError::Name
virtual const cpStr Name() const
Returns the name of this object.
Definition: eerror.h:189
EError
The base class for exceptions derived from std::exception.
Definition: eerror.h:92