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 15 of file user_errors.h.
void assertTrue |
( |
bool |
statement, |
|
|
errorType |
errorIfAssertionFails, |
|
|
std::string |
errorFunc, |
|
|
std::string |
errorMsgPrefix = "" , |
|
|
std::string |
errorMsgSuffix = "" |
|
) |
| |
|
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.".
- Parameters
-
[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.