casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Error.h
Go to the documentation of this file.
1 #if !defined(_ERROR_H)
2 
3 #include <string>
4 #include <stdarg.h>
5 
7 
8 class Error
9 {
10  public:
11 
12  Error();
13  Error(ErrorLevel errlev);
14  Error(ErrorLevel errlev, std::string message);
15  Error(ErrorLevel errlev, char* fmt, ... );
16  Error(int errlev);
17  Error(int errlev, std::string message);
18  Error(int errlev, char* fmt, ... );
19  ~Error();
20 
21  void notify(ErrorLevel errlev, std::string message);
22  void notify(std::string message);
23 
24  static void setAcceptableLevel(ErrorLevel errlev);
26  static std::string getAcceptableLevelToString();
27 
28  static ErrorLevel getLevel();
29  static std::string getLevelToString();
30  static std::string getErrorMessage();
31 
32  static void clearMessage();
33  static void clearErrLev();
34 
35  private:
37  static std::string errorMessage_;
38  static ErrorLevel errlev_;
39  std::string errorLog;
40  void printMessage(std::string message);
41 };
42 
43 #define _ERROR_H
44 #endif
The Error class represents a list of exceptions that may happen when errors occur.
Definition: ATMError.h:56
static void clearMessage()
Clear the stack of all the error messages which passed up to the last declaration which has finally t...
static std::string getAcceptableLevelToString()
Accessor to the current limit in the form of a std::string.
virtual ~Error()
Destructor.
ErrorLevel
Definition of the sequence of error levels sorted by ascending severity.
Definition: ATMError.h:42
static ErrorLevel getLevel()
Accessor to the severity level of the error which has just been declared.
static ErrorLevel getAcceptableLevel()
Accessor to the current limit below wich error are not thrown.
static ErrorLevel acceptableErrorLevel
Current acceptable level of severity.
Definition: ATMError.h:128
static void setAcceptableLevel(ErrorLevel criticalErrlev)
Setter to modify the critical current level of severity below which errors are tolerated.
Definition: ATMError.h:48
static ErrorLevel errlev_
Error level.
Definition: ATMError.h:130
std::string errorLog
Error log (TBD)
Definition: ATMError.h:131
void notify(ErrorLevel errlev, const std::string &message)
static std::string getLevelToString()
Accessor to the severity level, in the form of a std::string, of the error which has just been declar...
static std::string getErrorMessage()
Accessor to the error message for the error which has just been declared.
static std::string errorMessage_
Error message.
Definition: ATMError.h:129
static void clearErrLev()
Clear the stack of all the error levels which passed up to the last declaration which has finally tri...
void printMessage(const std::string &message)
Print utility.
Definition: ATMError.h:46