EpcTools
An event based multi-threaded C++ development framework.
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
EError Class Reference

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

#include <eerror.h>

Inheritance diagram for EError:
EThreadError_AlreadyInitialized EThreadError_UnableToInitialize

Public Types

enum  Severity { Info, Warning, Error }
 Error severity levels. More...
 

Public Member Functions

 EError ()
 Default constructor. More...
 
 EError (Severity eSeverity, cpStr pszText=NULL)
 Additonal constructor. More...
 
 EError (Severity eSeverity, Dword err, cpStr pszText=NULL)
 Additonal constructor. More...
 
 EError (Severity eSeverity, const std::string &txt)
 Additonal constructor. More...
 
 EError (Severity eSeverity, Dword err, const std::string &txt)
 Additonal constructor. More...
 
 EError (const EError &val)
 Copy constructor. More...
 
EErroroperator= (const EError &val)
 Assignment operator. More...
 
 operator cpStr ()
 The const char* extractor. More...
 
EErrorcopy (const EError &val)
 Copies the contents of the specified object to this object. More...
 
virtual const cpStr Name () const
 Returns the name of this object. More...
 
Void clear ()
 Clears the current contents of this error object. More...
 
cpStr getText ()
 Returns the text associated with this error. More...
 
Void setText (cpStr pszText)
 Sets the text associated with this error. More...
 
Void setTextf (cpStr pszFormat,...)
 Sets the text associated with this error. More...
 
Void appendText (cpStr pszText)
 appends the specified text to the current text of this error. More...
 
Void appendTextf (cpStr pszText,...)
 appends the specified text to the current error text using a printf style format string and parameters. More...
 
Void setSeverity (Severity eSeverity)
 Sets the severity level of this error object. More...
 
Void setSevere ()
 Sets the severity level of this error object to "Error". More...
 
Void setWarning ()
 Sets the severity level of this error object to "Warning". More...
 
Void setInfo ()
 Sets the severity level of this error object to "Info". More...
 
Bool isSevere ()
 Returns True if the severity is "Error". More...
 
Bool isWarning ()
 Returns True if the severity is "Warning". More...
 
Bool isInfo ()
 Returns True if the severity is "Info". More...
 
Bool isError ()
 Returns True if the severity is "Error". More...
 
Bool isErrorOrWarning ()
 Returns True if the severity is "Error" or "Warning". More...
 
Severity getSeverity ()
 Returns the current severity setting of this error object. More...
 
cpStr getSeverityText ()
 Returns the text based on the current error object's severity. More...
 
Dword getLastOsError ()
 Returns the current value of m_dwError. More...
 
Void setLastOsError (Dword dwError=-1)
 Sets the value of m_dwError. More...
 
Void appendLastOsError (Dword dwError=-1)
 Sets the value of m_dwError and appends the text description of the error to the current error text. More...
 
virtual const char * what () const throw ()
 The overloaded definition of the std::exception::what() method. More...
 

Static Public Member Functions

static cpStr getSeverityText (Severity eSeverity)
 Returns the text asociated with the specified severity code. More...
 
static cpStr getError (Int nError, EErrorMapEntry *pErrors)
 Returns a description for the specified application error code. More...
 

Public Attributes

Dword m_dwError
 The unsigned long error code (if appropriate) More...
 
Severity m_eSeverity
 Represents the severity of the error. More...
 

Detailed Description

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

Member Enumeration Documentation

◆ Severity

Error severity levels.

Enumerator
Info 

Informational.

Warning 

Warning.

Error 

Error.

Constructor & Destructor Documentation

◆ EError() [1/6]

EError::EError ( )
inline

Default constructor.

◆ EError() [2/6]

EError::EError ( Severity  eSeverity,
cpStr  pszText = NULL 
)
inline

Additonal constructor.

Parameters
eSeveritythe severity level for this error.
pszTextthis optional parameter is the text associated with this error.

◆ EError() [3/6]

EError::EError ( Severity  eSeverity,
Dword  err,
cpStr  pszText = NULL 
)
inline

Additonal constructor.

Parameters
eSeveritythe severity level for this error.
errnumeric error code.
pszTextthis optional parameter is the text associated with this error.

◆ EError() [4/6]

EError::EError ( Severity  eSeverity,
const std::string &  txt 
)
inline

Additonal constructor.

Parameters
eSeveritythe severity level for this error.
txtthis optional parameter is the text associated with this error.

◆ EError() [5/6]

EError::EError ( Severity  eSeverity,
Dword  err,
const std::string &  txt 
)
inline

Additonal constructor.

Parameters
eSeveritythe severity level for this error.
errnumeric error code.
txtthis optional parameter is the text associated with this error.

◆ EError() [6/6]

EError::EError ( const EError val)
inline

Copy constructor.

Member Function Documentation

◆ appendLastOsError()

Void EError::appendLastOsError ( Dword  dwError = -1)

Sets the value of m_dwError and appends the text description of the error to the current error text.

◆ appendText()

Void EError::appendText ( cpStr  pszText)
inline

appends the specified text to the current text of this error.

Parameters
pszTextThe text to append.

◆ appendTextf()

Void EError::appendTextf ( cpStr  pszText,
  ... 
)

appends the specified text to the current error text using a printf style format string and parameters.

Parameters
pszTextA printf style format string.
...Optinal parameters to be used as arguments to the format string.

◆ clear()

Void EError::clear ( )
inline

Clears the current contents of this error object.

◆ copy()

EError& EError::copy ( const EError val)
inline

Copies the contents of the specified object to this object.

Parameters
valThe source object to copy.
Returns
the current object

◆ getError()

cpStr EError::getError ( Int  nError,
EErrorMapEntry *  pErrors 
)
static

Returns a description for the specified application error code.

Parameters
nErrorThe error code to retrieve the description for.
pErrorsThe associated error map that contains the error definitions.
Returns
the description of the error value

◆ getLastOsError()

Dword EError::getLastOsError ( )
inline

Returns the current value of m_dwError.

Returns
the current error value

◆ getSeverity()

Severity EError::getSeverity ( )
inline

Returns the current severity setting of this error object.

Returns
the current severity value of this error object

◆ getSeverityText() [1/2]

cpStr EError::getSeverityText ( )
inline

Returns the text based on the current error object's severity.

Returns
the description of the severity of this error object

◆ getSeverityText() [2/2]

static cpStr EError::getSeverityText ( Severity  eSeverity)
inlinestatic

Returns the text asociated with the specified severity code.

Parameters
eSeverityThe severity code to retrieve the associated description.
Returns
the description of the supplied severity value

◆ getText()

cpStr EError::getText ( )
inline

Returns the text associated with this error.

Returns
the current description associated with this error object

◆ isError()

Bool EError::isError ( )
inline

Returns True if the severity is "Error".

Returns
True - severity is "Error", False - severity is not "Error"

◆ isErrorOrWarning()

Bool EError::isErrorOrWarning ( )
inline

Returns True if the severity is "Error" or "Warning".

Returns
True - is "Error" or "Warning", False - another value

◆ isInfo()

Bool EError::isInfo ( )
inline

Returns True if the severity is "Info".

Returns
True - severity is "Info", False - severity is not "Info"

◆ isSevere()

Bool EError::isSevere ( )
inline

Returns True if the severity is "Error".

Returns
True - severity is "Error", False - severity is not "Error"

◆ isWarning()

Bool EError::isWarning ( )
inline

Returns True if the severity is "Warning".

Returns
True - severity is "Warning", False - severity is not "Warning"

◆ Name()

virtual const cpStr EError::Name ( ) const
inlinevirtual

Returns the name of this object.

Returns
the name of class

This virtual method returns the name of the class. This method should be overridden in any derived class and set appropriately. The DECLARE_ERROR* macros handle this automatically.

◆ operator cpStr()

EError::operator cpStr ( )
inline

The const char* extractor.

Returns
the current description associated with this error object

◆ operator=()

EError& EError::operator= ( const EError val)
inline

Assignment operator.

Parameters
valThe source object to copy.
Returns
the current object

◆ setInfo()

Void EError::setInfo ( )
inline

Sets the severity level of this error object to "Info".

◆ setLastOsError()

Void EError::setLastOsError ( Dword  dwError = -1)

Sets the value of m_dwError.

Parameters
dwErrorThe new error value.

◆ setSevere()

Void EError::setSevere ( )
inline

Sets the severity level of this error object to "Error".

◆ setSeverity()

Void EError::setSeverity ( Severity  eSeverity)
inline

Sets the severity level of this error object.

Parameters
eSeverityThe new severity level.

◆ setText()

Void EError::setText ( cpStr  pszText)
inline

Sets the text associated with this error.

Parameters
pszTextthe text for this error

◆ setTextf()

Void EError::setTextf ( cpStr  pszFormat,
  ... 
)

Sets the text associated with this error.

Parameters
pszFormatA printf style format string.
...Optional parameters to be used as arguments to the format string.

◆ setWarning()

Void EError::setWarning ( )
inline

Sets the severity level of this error object to "Warning".

◆ what()

virtual const char* EError::what ( ) const
throw (
)
inlinevirtual

The overloaded definition of the std::exception::what() method.

Returns
the text message associated with the exception

Member Data Documentation

◆ m_dwError

Dword EError::m_dwError

The unsigned long error code (if appropriate)

◆ m_eSeverity

Severity EError::m_eSeverity

Represents the severity of the error.


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