CARLsim
5.0.0
CARLsim: a GPU-accelerated SNN simulator
|
Static Class for handling user errors. More...
#include <user_errors.h>
Static Public Member Functions | |
static void | assertTrue (bool statement, errorType errorIfAssertionFails, std::string errorFunc, std::string errorMsgPrefix="", std::string errorMsgSuffix="") |
simple wrapper for assert statement More... | |
This static class handles all possible errors that can be generated by the user. Such errors include incorret calls of CARLsim core functions, conceptual/chronological errors in setting up a network, etc. All these errors are supposed to be fatal; that is, an error message will be printed and CARLsim will exit.
Definition at line 13 of file user_errors.h.
enum errorType |
This enum contains all the different error codes that are possible (in alphabetical order). Whenever an error is thrown, it has to be assigned one of these values. There is also type UNKNOWN for unspecified errors.
Definition at line 24 of file user_errors.h.
|
static |
This function evaluates a certain statement to true or false, and if it false, it will throw an error. There is a standard error message for each user error type. This message can be extended by using a prefix and/or a suffix. For example: errorIfAssertionFails=CANNOT_BE_IDENTICAL, errorMsgPrefix="A", errorMsgSuffix="B" will print "A cannot be identical to B.".
[in] | statement | the logical statement to evaluate |
[in] | errorIfAssertionFails | the type of error to throw if assertion fails (from enum errorType) |
[in] | errorFunc | a string to indicate the location where the error occured |
[in] | errorMsgPrefix | a prefix for the error message |
[in] | errorMsgSuffix | a suffix for the error message |
**************************************************************************************************************** /// PUBLIC METHODS **************************************************************************************************************** ///
Definition at line 15 of file user_errors.cpp.