CARLsim  5.0.0
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 
81  static void assertTrue(bool statement, errorType errorIfAssertionFails, std::string errorFunc,
82  std::string errorMsgPrefix="", std::string errorMsgSuffix="");
83 
84 // static void userAssertNonZero();
85 // static void userAssertNonNegative();
86 
87 private:
88  // +++++ PRIVATE METHODS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //
89 
98  static void throwError(std::string errorFunc, errorType error, std::string errorMsgPrefix="",
99  std::string errorMsgSuffix="");
100 };
101 
102 #endif
UserErrors::CANNOT_BE_OFF
@ CANNOT_BE_OFF
parameter cannot be off
Definition: user_errors.h:37
UserErrors::CANNOT_BE_LARGER
@ CANNOT_BE_LARGER
parameter cannot have larger vaule than some vaule
Definition: user_errors.h:35
UserErrors::CANNOT_BE_SET_TO
@ CANNOT_BE_SET_TO
parameter cannot be set to
Definition: user_errors.h:40
UserErrors::CANNOT_BE_POSITIVE
@ CANNOT_BE_POSITIVE
parameter cannot have positive value (opposite to "must be", but includes zero)
Definition: user_errors.h:39
UserErrors::CANNOT_BE_IDENTICAL
@ CANNOT_BE_IDENTICAL
parameters cannot be identical
Definition: user_errors.h:32
UserErrors::CANNOT_BE_ON
@ CANNOT_BE_ON
parameter cannot be on
Definition: user_errors.h:38
UserErrors::MUST_BE_SMALLER
@ MUST_BE_SMALLER
parameter must be smaller than
Definition: user_errors.h:56
UserErrors::MUST_BE_IDENTICAL
@ MUST_BE_IDENTICAL
parameters must be identical
Definition: user_errors.h:48
UserErrors::UNKNOWN_GROUP_ID
@ UNKNOWN_GROUP_ID
the specified group id is unknown
Definition: user_errors.h:60
UserErrors::CAN_ONLY_BE_CALLED_IN_STATE
@ CAN_ONLY_BE_CALLED_IN_STATE
function can only be called in certain state
Definition: user_errors.h:27
UserErrors::MUST_BE_POSITIVE
@ MUST_BE_POSITIVE
parameter must have positive value
Definition: user_errors.h:53
UserErrors::NETWORK_ALREADY_RUN
@ NETWORK_ALREADY_RUN
function cannot be called because network has already bun run
Definition: user_errors.h:59
UserErrors::CANNOT_BE_CALLED_IN_STATE
@ CANNOT_BE_CALLED_IN_STATE
function cannot be called in certain state
Definition: user_errors.h:29
UserErrors::MUST_BE_ON
@ MUST_BE_ON
parameter must be on
Definition: user_errors.h:52
UserErrors::FILE_CANNOT_CREATE
@ FILE_CANNOT_CREATE
could not create a file
Definition: user_errors.h:43
UserErrors::MUST_BE_IN_RANGE
@ MUST_BE_IN_RANGE
parameter must be in some range
Definition: user_errors.h:49
UserErrors::CANNOT_BE_NULL
@ CANNOT_BE_NULL
parameter cannot have NULL value
Definition: user_errors.h:34
UserErrors::FILE_CANNOT_OPEN
@ FILE_CANNOT_OPEN
could not open file
Definition: user_errors.h:44
UserErrors::CANNOT_BE_CONN_TWICE
@ CANNOT_BE_CONN_TWICE
cannot be connected twice
Definition: user_errors.h:31
UserErrors::IS_DEPRECATED
@ IS_DEPRECATED
deprecated function
Definition: user_errors.h:46
UserErrors::MUST_BE_LOGGER_CUSTOM
@ MUST_BE_LOGGER_CUSTOM
must be in custom logger mode
Definition: user_errors.h:47
UserErrors::WRONG_NEURON_TYPE
@ WRONG_NEURON_TYPE
function cannot be applied to neuron type
Definition: user_errors.h:62
UserErrors::MUST_BE_LARGER
@ MUST_BE_LARGER
parameter must be larger than
Definition: user_errors.h:55
UserErrors::CANNOT_BE_CALLED_IN_MODE
@ CANNOT_BE_CALLED_IN_MODE
function cannot be called in certain mode
Definition: user_errors.h:28
UserErrors::MUST_BE_OFF
@ MUST_BE_OFF
parameter must be off
Definition: user_errors.h:51
UserErrors::CAN_ONLY_BE_CALLED_IN_MODE
@ CAN_ONLY_BE_CALLED_IN_MODE
function can only be called in certain mode
Definition: user_errors.h:26
UserErrors::UNKNOWN
@ UNKNOWN
an unknown error
Definition: user_errors.h:61
UserErrors::errorType
errorType
an enum of all possible error codes
Definition: user_errors.h:24
UserErrors
Static Class for handling user errors.
Definition: user_errors.h:13
UserErrors::CANNOT_BE_UNKNOWN
@ CANNOT_BE_UNKNOWN
parameter cannot be of type UNKNOWN
Definition: user_errors.h:41
UserErrors::FILE_CANNOT_READ
@ FILE_CANNOT_READ
could not read file
Definition: user_errors.h:45
UserErrors::CANNOT_BE_ZERO
@ CANNOT_BE_ZERO
parameter cannot be zero
Definition: user_errors.h:42
UserErrors::MUST_BE_NEGATIVE
@ MUST_BE_NEGATIVE
parameter must have negative value
Definition: user_errors.h:50
UserErrors::MUST_BE_SET_TO
@ MUST_BE_SET_TO
parameter must be set to
Definition: user_errors.h:54
UserErrors::MUST_HAVE_SAME_SIGN
@ MUST_HAVE_SAME_SIGN
some parameters must have the same sign
Definition: user_errors.h:58
UserErrors::assertTrue
static void assertTrue(bool statement, errorType errorIfAssertionFails, std::string errorFunc, std::string errorMsgPrefix="", std::string errorMsgSuffix="")
simple wrapper for assert statement
Definition: user_errors.cpp:15
UserErrors::CANNOT_BE_NEGATIVE
@ CANNOT_BE_NEGATIVE
parameter cannot have negative value (opposite to "must be", but includes zero)
Definition: user_errors.h:33
UserErrors::CANNOT_BE_CONN_SYN_AND_COMP
@ CANNOT_BE_CONN_SYN_AND_COMP
cannot be both synaptically and compartmentally connected
Definition: user_errors.h:30
UserErrors::ALL_NOT_ALLOWED
@ ALL_NOT_ALLOWED
keyword ALL is not allowed for this variable
Definition: user_errors.h:25
UserErrors::CANNOT_BE_SMALLER
@ CANNOT_BE_SMALLER
parameter cannot have smaller vaule than some vaule
Definition: user_errors.h:36
UserErrors::MUST_BE_ZERO
@ MUST_BE_ZERO
parameter must be 0
Definition: user_errors.h:57