![]() |
A fuzzy logic C++ library
|
This class is used to hold information about an error that occurred. It inherits from std::exception. More...
#include <error_handler.hpp>
Inheritance diagram for slifis::ERROR_HANDLER:
Collaboration diagram for slifis::ERROR_HANDLER:Public Member Functions | |
| ERROR_HANDLER (EN_ERRMSG err, const char *func, const char *file, int line, clock_t cl) throw () | |
| ~ERROR_HANDLER () throw () | |
| const char * | what () const throw () |
Private Attributes | |
| EN_ERRMSG | _err |
| Error code. | |
| std::string | _msg |
| Corresponding text. | |
| std::string | _func |
| std::string | _file |
| int | _line |
| clock_t | _clock |
| current CPU time | |
This class is used to hold information about an error that occurred. It inherits from std::exception.
It follows the classical C++ error scheme: it overloads the 'what' function, so when printed, all the information is available.
For example, to catch all errors, the user code can look like this:
try { ... do something than can throw an error } catch( const ERROR_HANDLER& e ) { cout << "gotcha ! Error message is " << e.what(); }
| slifis::ERROR_HANDLER::ERROR_HANDLER | ( | EN_ERRMSG | err, |
| const char * | func, | ||
| const char * | file, | ||
| int | line, | ||
| clock_t | cl | ||
| ) | throw () [inline] |
| slifis::ERROR_HANDLER::~ERROR_HANDLER | ( | ) | throw () [inline] |
| const char* slifis::ERROR_HANDLER::what | ( | ) | const throw () [inline] |
EN_ERRMSG slifis::ERROR_HANDLER::_err [private] |
Error code.
Referenced by what().
std::string slifis::ERROR_HANDLER::_msg [private] |
Corresponding text.
std::string slifis::ERROR_HANDLER::_func [private] |
Referenced by what().
std::string slifis::ERROR_HANDLER::_file [private] |
Referenced by what().
int slifis::ERROR_HANDLER::_line [private] |
Referenced by what().
clock_t slifis::ERROR_HANDLER::_clock [private] |
current CPU time
Referenced by what().
1.7.6.1