casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Error Class Reference

The Error class represents a list of exceptions that may happen when errors occur. More...

#include <ATMError.h>

Public Member Functions

 Error ()
 
 Error (ErrorLevel errlev)
 
 Error (ErrorLevel errlev, const std::string &message)
 Declare the occurrence of an error. More...
 
 Error (ErrorLevel errlev, char *fmt,...)
 Declare the occurrence of an error. More...
 
virtual ~Error ()
 Destructor. More...
 
void notify (ErrorLevel errlev, const std::string &message)
 
void notify (const std::string &message)
 
 Error ()
 
 Error (ErrorLevel errlev)
 
 Error (ErrorLevel errlev, std::string message)
 
 Error (ErrorLevel errlev, char *fmt,...)
 
 Error (int errlev)
 
 Error (int errlev, std::string message)
 
 Error (int errlev, char *fmt,...)
 
 ~Error ()
 
void notify (ErrorLevel errlev, std::string message)
 
void notify (std::string message)
 

Static Public Member Functions

static void setAcceptableLevel (ErrorLevel criticalErrlev)
 Setter to modify the critical current level of severity below which errors are tolerated. More...
 
static ErrorLevel getAcceptableLevel ()
 Accessor to the current limit below wich error are not thrown. More...
 
static std::string getAcceptableLevelToString ()
 Accessor to the current limit in the form of a std::string. More...
 
static ErrorLevel getLevel ()
 Accessor to the severity level of the error which has just been declared. More...
 
static std::string getLevelToString ()
 Accessor to the severity level, in the form of a std::string, of the error which has just been declared. More...
 
static std::string getErrorMessage ()
 Accessor to the error message for the error which has just been declared. More...
 
static void clearMessage ()
 Clear the stack of all the error messages which passed up to the last declaration which has finally triggered the exception. More...
 
static void clearErrLev ()
 Clear the stack of all the error levels which passed up to the last declaration which has finally triggered the exception. More...
 
static void setAcceptableLevel (ErrorLevel errlev)
 
static ErrorLevel getAcceptableLevel ()
 
static std::string getAcceptableLevelToString ()
 
static ErrorLevel getLevel ()
 
static std::string getLevelToString ()
 
static std::string getErrorMessage ()
 
static void clearMessage ()
 
static void clearErrLev ()
 

Private Member Functions

void printMessage (const std::string &message)
 Print utility. More...
 
void printMessage (std::string message)
 

Private Attributes

std::string errorLog
 Error log (TBD) More...
 

Static Private Attributes

static ErrorLevel acceptableErrorLevel
 Current acceptable level of severity. More...
 
static std::string errorMessage_
 Error message. More...
 
static ErrorLevel errlev_
 Error level. More...
 

Detailed Description

The Error class represents a list of exceptions that may happen when errors occur.

To every error is associated a severity level. There is at any time an acceptable level of severity. If an error occurs at that level or a more severe level, an exception is thrown. The critical level of severity below which errors are tolerated can be modified.

Definition at line 56 of file ATMError.h.

Constructor & Destructor Documentation

Error::Error ( )
Error::Error ( ErrorLevel  errlev)
Error::Error ( ErrorLevel  errlev,
const std::string &  message 
)

Declare the occurrence of an error.

Precondition
the default level of tolerance for an acceptable error is used or a different critical level has been set.
Parameters
errlevthe level of severity for the error being declared
messageError message
Postcondition
the declaration may have or may have not thrown an exception depending on the current tolerance about the severity level.
Error::Error ( ErrorLevel  errlev,
char *  fmt,
  ... 
)

Declare the occurrence of an error.

Precondition
the default level of tolerance for an acceptable error is used or a different critical level has been set.
Parameters
errlevthe level of severity for the error being declared
fmtError message format as in a standard C printf
...Variable arguments as in printf
Postcondition
the declaration may have or may have not thrown an exception depending on the current tolerance about the severity level.
virtual Error::~Error ( )
virtual

Destructor.

Error::Error ( )
Error::Error ( ErrorLevel  errlev)
Error::Error ( ErrorLevel  errlev,
std::string  message 
)
Error::Error ( ErrorLevel  errlev,
char *  fmt,
  ... 
)
Error::Error ( int  errlev)
Error::Error ( int  errlev,
std::string  message 
)
Error::Error ( int  errlev,
char *  fmt,
  ... 
)
Error::~Error ( )

Member Function Documentation

static void Error::clearErrLev ( )
static
static void Error::clearErrLev ( )
static

Clear the stack of all the error levels which passed up to the last declaration which has finally triggered the exception.

static void Error::clearMessage ( )
static
static void Error::clearMessage ( )
static

Clear the stack of all the error messages which passed up to the last declaration which has finally triggered the exception.

static ErrorLevel Error::getAcceptableLevel ( )
static
static ErrorLevel Error::getAcceptableLevel ( )
static

Accessor to the current limit below wich error are not thrown.

static std::string Error::getAcceptableLevelToString ( )
static
static std::string Error::getAcceptableLevelToString ( )
static

Accessor to the current limit in the form of a std::string.

static std::string Error::getErrorMessage ( )
static
static std::string Error::getErrorMessage ( )
static

Accessor to the error message for the error which has just been declared.

static ErrorLevel Error::getLevel ( )
static
static ErrorLevel Error::getLevel ( )
static

Accessor to the severity level of the error which has just been declared.

static std::string Error::getLevelToString ( )
static
static std::string Error::getLevelToString ( )
static

Accessor to the severity level, in the form of a std::string, of the error which has just been declared.

void Error::notify ( ErrorLevel  errlev,
std::string  message 
)
void Error::notify ( std::string  message)
void Error::notify ( ErrorLevel  errlev,
const std::string &  message 
)
void Error::notify ( const std::string &  message)
void Error::printMessage ( std::string  message)
private
void Error::printMessage ( const std::string &  message)
private

Print utility.

static void Error::setAcceptableLevel ( ErrorLevel  errlev)
static
static void Error::setAcceptableLevel ( ErrorLevel  criticalErrlev)
static

Setter to modify the critical current level of severity below which errors are tolerated.

Parameters
criticalErrlevcritical limit: when errlev >= criticalErrlev an exception will be thrown
Postcondition
New declarations of errors will be thrown or not according to this new critical limit

Member Data Documentation

static ErrorLevel Error::acceptableErrorLevel
staticprivate

Current acceptable level of severity.

Definition at line 128 of file ATMError.h.

static ErrorLevel Error::errlev_
staticprivate

Error level.

Definition at line 130 of file ATMError.h.

std::string Error::errorLog
private

Error log (TBD)

Definition at line 131 of file ATMError.h.

static std::string Error::errorMessage_
staticprivate

Error message.

Definition at line 129 of file ATMError.h.


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