|
|
lucid
0.0.1
Lifting-based Uncertain Control Invariant Dynamics
|
#include <fmt/core.h>#include <stdexcept>#include "lucid/util/exception.h"#include "lucid/util/logging.h"Macros | |
| #define | LUCID_ERROR_LOG_AND_THROW(ex, msg, ...) |
| Log an error message and throw an exception. | |
| #define | LUCID_CRITICAL_LOG_AND_THROW(ex, msg, ...) |
| Log a critical message and throw an exception. | |
| #define | LUCID_ASSERT(condition, message) |
| Assert that a condition is true, throwing an exception if it fails. | |
| #define | LUCID_UNREACHABLE() |
| Mark code that should never be reached, throwing an exception if executed. | |
| #define | LUCID_CHECK_ARGUMENT(condition, argument, actual) |
| Check that an argument satisfies a condition, throwing an exception if it doesn't. | |
| #define | LUCID_CHECK_ARGUMENT_EXPECTED(condition, argument, actual, expected) |
| Check that an argument satisfies a condition with expected value information. | |
| #define | LUCID_CHECK_ARGUMENT_CMP(value, op, expected) |
| Check that a value satisfies a comparison operation with an expected value. | |
| #define | LUCID_CHECK_ARGUMENT_EQ(value, expected) |
| Check that a value equals an expected value. | |
| #define | LUCID_NOT_IMPLEMENTED() |
| Throw a LucidNotImplementedException when functionality is not yet implemented. | |
| #define | LUCID_RUNTIME_ERROR(msg) |
| Throw a LucidException with a simple message. | |
| #define | LUCID_RUNTIME_ERROR_FMT(msg, ...) |
| Throw a LucidException with a formatted message. | |
| #define | LUCID_OUT_OF_RANGE(msg) |
| Throw a LucidOutOfRangeException with a simple message. | |
| #define | LUCID_OUT_OF_RANGE_FMT(msg, ...) |
| Throw a LucidOutOfRangeException with a formatted message. | |
| #define | LUCID_INVALID_ARGUMENT(argument, actual) |
| Log an error message showing the current value and throw a LucidInvalidArgumentException. | |
| #define | LUCID_INVALID_ARGUMENT_EXPECTED(argument, actual, expected) |
| Log an error message, showing the expected value and throw a LucidInvalidArgumentException. | |
| #define | LUCID_INVALID_HYPER_PARAMETER(parameter, type) |
| Log an error message and throw a LucidInvalidArgumentException. | |
| #define | LUCID_PY_ERROR(msg) |
| Log an error message and throw a LucidPyException. | |
| #define | LUCID_PY_ERROR_FMT(msg, ...) |
| Log an error message and throw a LucidPyException. | |
| #define | LUCID_NOT_SUPPORTED(msg) |
| Throw a LucidNotSupportedException when a functionality is not supported. | |
| #define | LUCID_NOT_SUPPORTED_MISSING_BUILD_DEPENDENCY(msg, dependency) |
| Throw a LucidNotSupportedException when a functionality is not supported because the software was compiled without a required dependency. | |
| #define | LUCID_NOT_SUPPORTED_MISSING_RUNTIME_DEPENDENCY(msg, dependency) |
| Throw a LucidNotSupportedException when a functionality is not supported because of a missing runtime dependency. | |
Utilities that verify assumptions made by the program and aborts the program if those assumptions are not true. If NDEBUG is defined, most of the macro do nothing and give no explanation. It makes the program faster, but less useful for debugging.
| #define LUCID_ASSERT | ( | condition, | |
| message ) |
Assert that a condition is true, throwing an exception if it fails.
This macro checks the condition and throws a LucidAssertionException with file and line information if the condition is false. Only active when NDEBUG is not defined (debug builds).
| condition | the condition to check |
| message | descriptive message explaining what the assertion checks |
| LucidAssertionException | if the condition is false |
| #define LUCID_CHECK_ARGUMENT | ( | condition, | |
| argument, | |||
| actual ) |
Check that an argument satisfies a condition, throwing an exception if it doesn't.
This macro validates function arguments and throws a LucidInvalidArgumentException if the condition is false. Only active when NCHECK is not defined.
| condition | the condition that must be true |
| argument | name of the argument being checked |
| actual | the actual value of the argument |
| LucidInvalidArgumentException | if the condition is false |
| #define LUCID_CHECK_ARGUMENT_CMP | ( | value, | |
| op, | |||
| expected ) |
Check that a value satisfies a comparison operation with an expected value.
This macro validates that value op expected is true, where op is a comparison operator. Only active when NCHECK is not defined.
| value | the value to check |
| op | the comparison operator (e.g., ==, !=, <, >, <=, >=) |
| expected | the expected value for comparison |
| LucidInvalidArgumentException | if the comparison fails |
| #define LUCID_CHECK_ARGUMENT_EQ | ( | value, | |
| expected ) |
Check that a value equals an expected value.
This macro validates that value == expected is true. Only active when NCHECK is not defined.
| value | the value to check |
| expected | the expected value |
| LucidInvalidArgumentException | if value != expected |
| #define LUCID_CHECK_ARGUMENT_EXPECTED | ( | condition, | |
| argument, | |||
| actual, | |||
| expected ) |
Check that an argument satisfies a condition with expected value information.
This macro validates function arguments and provides both actual and expected values in the error message. Only active when NCHECK is not defined.
| condition | the condition that must be true |
| argument | name of the argument being checked |
| actual | the actual value of the argument |
| expected | the expected value or description |
| LucidInvalidArgumentException | if the condition is false |
| #define LUCID_CRITICAL_LOG_AND_THROW | ( | ex, | |
| msg, | |||
| ... ) |
Log a critical message and throw an exception.
This macro logs the formatted message at CRITICAL level and then throws the specified exception.
| ex | the exception type to throw (without lucid::exception:: prefix) |
| msg | the format string for the critical message |
| ... | arguments to format into the message |
| ex | the specified exception with the formatted message |
| #define LUCID_ERROR_LOG_AND_THROW | ( | ex, | |
| msg, | |||
| ... ) |
Log an error message and throw an exception.
This macro logs the formatted message at ERROR level and then throws the specified exception.
| ex | the exception type to throw (without lucid::exception:: prefix) |
| msg | the format string for the error message |
| ... | arguments to format into the message |
| ex | the specified exception with the formatted message |
| #define LUCID_INVALID_ARGUMENT | ( | argument, | |
| actual ) |
Log an error message showing the current value and throw a LucidInvalidArgumentException.
| argument | hyperparameter that is invalid |
| actual | actual value of the hyperparameter |
| #define LUCID_INVALID_ARGUMENT_EXPECTED | ( | argument, | |
| actual, | |||
| expected ) |
Log an error message, showing the expected value and throw a LucidInvalidArgumentException.
| argument | hyperparameter that is invalid |
| actual | actual value of the hyperparameter |
| expected | expected value of the hyperparameter |
| #define LUCID_INVALID_HYPER_PARAMETER | ( | parameter, | |
| type ) |
Log an error message and throw a LucidInvalidArgumentException.
Used when a hyperparameter is invalid has an invalid type.
| parameter | hyperparameter that is invalid |
| type | type of the hyperparameter |
| #define LUCID_NOT_IMPLEMENTED | ( | ) |
Throw a LucidNotImplementedException when functionality is not yet implemented.
This macro logs an error and throws an exception with file and line information.
| LucidNotImplementedException | always |
| #define LUCID_NOT_SUPPORTED | ( | msg | ) |
Throw a LucidNotSupportedException when a functionality is not supported.
| msg | functionality or feature that is not supported |
| #define LUCID_NOT_SUPPORTED_MISSING_BUILD_DEPENDENCY | ( | msg, | |
| dependency ) |
Throw a LucidNotSupportedException when a functionality is not supported because the software was compiled without a required dependency.
| msg | functionality or feature that is not supported |
| dependency | missing runtime dependency that is required for the functionality to work |
| LucidNotSupportedException |
| #define LUCID_NOT_SUPPORTED_MISSING_RUNTIME_DEPENDENCY | ( | msg, | |
| dependency ) |
Throw a LucidNotSupportedException when a functionality is not supported because of a missing runtime dependency.
| msg | functionality or feature that is not supported. |
| dependency | missing runtime dependency that is required for the functionality to work |
| LucidNotSupportedException |
| #define LUCID_OUT_OF_RANGE | ( | msg | ) |
Throw a LucidOutOfRangeException with a simple message.
This macro logs an error and throws an out-of-range exception.
| msg | the error message |
| LucidOutOfRangeException | always |
| #define LUCID_OUT_OF_RANGE_FMT | ( | msg, | |
| ... ) |
Throw a LucidOutOfRangeException with a formatted message.
This macro logs an error and throws an out-of-range exception with formatted arguments.
| msg | the format string for the error message |
| ... | arguments to format into the message |
| LucidOutOfRangeException | always |
| #define LUCID_PY_ERROR | ( | msg | ) |
Log an error message and throw a LucidPyException.
| msg | message to log |
| #define LUCID_PY_ERROR_FMT | ( | msg, | |
| ... ) |
Log an error message and throw a LucidPyException.
| msg | error message to log |
| #define LUCID_RUNTIME_ERROR | ( | msg | ) |
Throw a LucidException with a simple message.
This macro logs an error and throws a general LucidException.
| msg | the error message |
| LucidException | always |
| #define LUCID_RUNTIME_ERROR_FMT | ( | msg, | |
| ... ) |
Throw a LucidException with a formatted message.
This macro logs an error and throws a general LucidException with formatted arguments.
| msg | the format string for the error message |
| ... | arguments to format into the message |
| LucidException | always |
| #define LUCID_UNREACHABLE | ( | ) |
Mark code that should never be reached, throwing an exception if executed.
This macro throws a LucidUnreachableException with file and line information. Only active when NDEBUG is not defined (debug builds).
| LucidUnreachableException | always |