libDAI
|
Error handling in libDAI is done by throwing an instance of the Exception class. More...
#include <dai/exceptions.h>
Public Types | |
enum | Code { NOT_IMPLEMENTED, ASSERTION_FAILED, IMPOSSIBLE_TYPECAST, OBJECT_NOT_FOUND, BELIEF_NOT_AVAILABLE, UNKNOWN_ENUM_VALUE, UNKNOWN_DAI_ALGORITHM, UNKNOWN_PARAMETER_ESTIMATION_METHOD, UNKNOWN_PROPERTY_TYPE, UNKNOWN_PROPERTY, MALFORMED_PROPERTY, NOT_ALL_PROPERTIES_SPECIFIED, INVALID_ALIAS, CANNOT_READ_FILE, CANNOT_WRITE_FILE, INVALID_FACTORGRAPH_FILE, INVALID_EVIDENCE_FILE, INVALID_EMALG_FILE, NOT_NORMALIZABLE, MULTIPLE_UNDO, FACTORGRAPH_NOT_CONNECTED, INTERNAL_ERROR, RUNTIME_ERROR, OUT_OF_MEMORY, NUM_ERRORS } |
Enumeration of exceptions used in libDAI. More... | |
Public Member Functions | |
Exception (Code code, const char *filename, const char *function, const char *line, const std::string &detailedMsg) | |
Constructor. More... | |
~Exception () throw () | |
Destructor. More... | |
Code | getCode () const |
Returns error code of this exception. More... | |
Code | code () const |
Returns error code of this exception. More... | |
const std::string & | getMsg () const |
Returns short error message of this exception. More... | |
const std::string & | getDetailedMsg () const |
Returns detailed error message of this exception. More... | |
const std::string & | getFilename () const |
Returns filename where this exception was thrown. More... | |
const std::string & | getFunction () const |
Returns function name in which this exception was thrown. More... | |
const std::string & | getLine () const |
Returns line number where this exception was thrown. More... | |
const std::string & | message (const Code c) const |
Returns error message corresponding to an error code. More... | |
Private Attributes | |
Code | _errorcode |
Contains the error code of this exception. More... | |
std::string | _detailedMsg |
Contains the detailed message of this exception, if any. More... | |
std::string | _filename |
Contains the filename where this exception was thrown. More... | |
std::string | _function |
Contains the function name in which this exception was thrown. More... | |
std::string | _line |
Contains the line number where this exception was thrown. More... | |
Static Private Attributes | |
static std::string | ErrorStrings [NUM_ERRORS] |
Error messages corresponding to the exceptions enumerated above. More... | |
Error handling in libDAI is done by throwing an instance of the Exception class.
The Exception class inherits from std::runtime_error. It defines several types of exceptions and corresponding error messages. The recommended way to throw an instance of the Exception class is by using the #DAI_THROW or DAI_THROWE macros.
enum dai::Exception::Code |
Enumeration of exceptions used in libDAI.
|
inline |
Constructor.
|
inline |
Destructor.
|
inline |
Returns error code of this exception.
|
inline |
Returns error code of this exception.
|
inline |
Returns short error message of this exception.
|
inline |
Returns detailed error message of this exception.
|
inline |
Returns filename where this exception was thrown.
|
inline |
Returns function name in which this exception was thrown.
|
inline |
Returns line number where this exception was thrown.
|
inline |
Returns error message corresponding to an error code.
|
private |
Contains the error code of this exception.
|
private |
Contains the detailed message of this exception, if any.
|
private |
Contains the filename where this exception was thrown.
|
private |
Contains the function name in which this exception was thrown.
|
private |
Contains the line number where this exception was thrown.
|
staticprivate |
Error messages corresponding to the exceptions enumerated above.