CARLsim  3.1.3
CARLsim: a GPU-accelerated SNN simulator
user_errors.h
Go to the documentation of this file.
1 #ifndef _USER_ERRORS_H_
2 #define _USER_ERRORS_H_
3 
4 #include <string> // std::string
5 
13 class UserErrors {
14 public:
15  // +++++ PUBLIC PROPERTIES ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //
16 
24  enum errorType {
63  };
64 
65 
66  // +++++ PUBLIC METHODS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //
67 
82  static void assertFalse(bool statement, errorType errorIfAssertionFails, const std::string& errorFunc,
83  const std::string& errorMsgPrefix="", const std::string& errorMsgSuffix="");
84 
99  static void assertTrue(bool statement, errorType errorIfAssertionFails, const std::string& errorFunc,
100  const std::string& errorMsgPrefix="", const std::string& errorMsgSuffix="");
101 
102 // static void userAssertNonZero();
103 // static void userAssertNonNegative();
104 
105 private:
106  // +++++ PRIVATE METHODS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //
107 
116  static void throwError(const std::string& errorFunc, errorType error, const std::string& errorMsgPrefix="",
117  const std::string& errorMsgSuffix="");
118 };
119 
120 #endif
parameter cannot have smaller vaule than some vaule
Definition: user_errors.h:36
parameter cannot be zero
Definition: user_errors.h:42
parameters must be identical
Definition: user_errors.h:47
parameters cannot be identical
Definition: user_errors.h:32
could not open file
Definition: user_errors.h:44
parameter cannot be of type UNKNOWN
Definition: user_errors.h:41
could not create a file
Definition: user_errors.h:43
function cannot be called in certain mode
Definition: user_errors.h:28
errorType
an enum of all possible error codes
Definition: user_errors.h:24
parameter must be 0
Definition: user_errors.h:57
function cannot be called in certain state
Definition: user_errors.h:29
function cannot be called because network has already bun run
Definition: user_errors.h:59
parameter cannot have larger vaule than some vaule
Definition: user_errors.h:35
some parameters must have the same sign
Definition: user_errors.h:58
the specified group id is unknown
Definition: user_errors.h:60
parameter must be set to
Definition: user_errors.h:54
deprecated function
Definition: user_errors.h:45
parameter cannot be set to
Definition: user_errors.h:40
parameter must be in some range
Definition: user_errors.h:48
parameter cannot have NULL value
Definition: user_errors.h:34
parameter must be off
Definition: user_errors.h:51
an unknown error
Definition: user_errors.h:61
function cannot be applied to neuron type
Definition: user_errors.h:62
must be in custom logger mode
Definition: user_errors.h:49
static void assertFalse(bool statement, errorType errorIfAssertionFails, const std::string &errorFunc, const std::string &errorMsgPrefix="", const std::string &errorMsgSuffix="")
Checks whether assertion statement is false, else throws error.
parameter cannot be on
Definition: user_errors.h:38
parameter must be smaller than
Definition: user_errors.h:56
parameter cannot have positive value (opposite to "must be", but includes zero)
Definition: user_errors.h:39
parameter must be on
Definition: user_errors.h:52
parameter must be larger than
Definition: user_errors.h:55
function can only be called in certain state
Definition: user_errors.h:27
parameter cannot be off
Definition: user_errors.h:37
keyword ALL is not allowed for this variable
Definition: user_errors.h:25
cannot be connected twice
Definition: user_errors.h:31
cannot be both synaptically and compartmentally connected
Definition: user_errors.h:30
parameter must have negative value
Definition: user_errors.h:50
parameter must have positive value
Definition: user_errors.h:53
function can only be called in certain mode
Definition: user_errors.h:26
static void assertTrue(bool statement, errorType errorIfAssertionFails, const std::string &errorFunc, const std::string &errorMsgPrefix="", const std::string &errorMsgSuffix="")
Checks whether assertion statement is true, else throws error.
parameter cannot have negative value (opposite to "must be", but includes zero)
Definition: user_errors.h:33
Static Class for handling user errors.
Definition: user_errors.h:13