MRPT
2.0.4
|
#include <mrpt/core/common.h>
#include <mrpt/core/format.h>
#include <stdexcept>
#include <string>
#include <string_view>
Go to the source code of this file.
Namespaces | |
mrpt | |
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. | |
mrpt::internal | |
Macros | |
#define | THROW_TYPED_EXCEPTION(msg, exceptionClass) |
#define | THROW_EXCEPTION(msg) THROW_TYPED_EXCEPTION(msg, std::logic_error) |
#define | THROW_EXCEPTION_FMT(_FORMAT_STRING, ...) THROW_EXCEPTION(mrpt::format(_FORMAT_STRING, __VA_ARGS__)) |
#define | THROW_TYPED_EXCEPTION_FMT(exceptionClass, _FORMAT_STRING, ...) |
#define | THROW_STACKED_EXCEPTION |
#define | THROW_STACKED_EXCEPTION_CUSTOM_MSG2(stuff, param1) |
#define | MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V) |
For use in CSerializable implementations. More... | |
#define | ASSERTMSG_(f, __ERROR_MSG) |
Defines an assertion mechanism. More... | |
#define | ASSERT_(f) ASSERTMSG_(f, std::string("Assert condition failed: ") + ::std::string(#f)) |
Defines an assertion mechanism. More... | |
#define | MRPT_CHECK_NORMAL_NUMBER(v) |
Throws an exception if the number is NaN, IND, or +/-INF, or return the same number otherwise. More... | |
#define | ASRT_FAIL(__CONDITIONSTR, __A, __B, __ASTR, __BSTR) |
#define | ASSERT_EQUAL_(__A, __B) |
Assert comparing two values, reporting their actual values upon failure. More... | |
#define | ASSERT_NOT_EQUAL_(__A, __B) |
#define | ASSERT_BELOW_(__A, __B) |
#define | ASSERT_ABOVE_(__A, __B) |
#define | ASSERT_BELOWEQ_(__A, __B) |
#define | ASSERT_ABOVEEQ_(__A, __B) |
#define | ASSERTDEB_(f) while (0){} |
Defines an assertion mechanism - only when compiled in debug. More... | |
#define | ASSERTDEBMSG_(f, __ERROR_MSG) while (0){} |
#define | ASSERTDEB_EQUAL_(__A, __B) while (0){} |
#define | ASSERTDEB_NOT_EQUAL_(__A, __B) while (0){} |
#define | ASSERTDEB_BELOW_(__A, __B) while (0){} |
#define | ASSERTDEB_ABOVE_(__A, __B) while (0){} |
#define | ASSERTDEB_BELOWEQ_(__A, __B) while (0){} |
#define | ASSERTDEB_ABOVEEQ_(__A, __B) while (0){} |
#define | MRPT_TRY_START |
The start of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an exception. More... | |
#define | MRPT_TRY_END |
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an exception. More... | |
#define | MRPT_TRY_END_WITH_CLEAN_UP(stuff) |
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an exception, including a "clean up" piece of code to be run before throwing the exceptions. More... | |
#define | MRPT_PROFILE_FUNC_START |
#define | MRPT_START |
#define | MRPT_END MRPT_TRY_END |
#define | MRPT_END_WITH_CLEAN_UP(stuff) MRPT_TRY_END_WITH_CLEAN_UP(stuff) |
Functions | |
std::string | mrpt::internal::exception_line_msg (const std::string_view &msg, const char *filename, unsigned int line, const char *function_name) |
template<typename A , typename B > | |
std::string | mrpt::internal::asrt_fail (std::string s, A &&a, B &&b, const char *astr, const char *bstr) |
std::string | mrpt::exception_to_str (const std::exception &e) |
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THROW_EXCEPTION,...) in between MRPT_START/MRPT_END macros, will contain function names and line numbers across the call stack at the original throw point. More... | |
#define ASRT_FAIL | ( | __CONDITIONSTR, | |
__A, | |||
__B, | |||
__ASTR, | |||
__BSTR | |||
) |
Definition at line 133 of file exceptions.h.
#define ASSERT_ | ( | f | ) | ASSERTMSG_(f, std::string("Assert condition failed: ") + ::std::string(#f)) |
Defines an assertion mechanism.
Definition at line 121 of file exceptions.h.
#define ASSERT_ABOVE_ | ( | __A, | |
__B | |||
) |
Definition at line 156 of file exceptions.h.
#define ASSERT_ABOVEEQ_ | ( | __A, | |
__B | |||
) |
Definition at line 168 of file exceptions.h.
#define ASSERT_BELOW_ | ( | __A, | |
__B | |||
) |
Definition at line 150 of file exceptions.h.
#define ASSERT_BELOWEQ_ | ( | __A, | |
__B | |||
) |
Definition at line 162 of file exceptions.h.
#define ASSERT_EQUAL_ | ( | __A, | |
__B | |||
) |
Assert comparing two values, reporting their actual values upon failure.
Definition at line 138 of file exceptions.h.
#define ASSERT_NOT_EQUAL_ | ( | __A, | |
__B | |||
) |
Definition at line 144 of file exceptions.h.
#define ASSERTDEB_ | ( | f | ) | while (0){} |
Defines an assertion mechanism - only when compiled in debug.
Definition at line 191 of file exceptions.h.
#define ASSERTDEB_ABOVE_ | ( | __A, | |
__B | |||
) | while (0){} |
Definition at line 196 of file exceptions.h.
#define ASSERTDEB_ABOVEEQ_ | ( | __A, | |
__B | |||
) | while (0){} |
Definition at line 198 of file exceptions.h.
#define ASSERTDEB_BELOW_ | ( | __A, | |
__B | |||
) | while (0){} |
Definition at line 195 of file exceptions.h.
#define ASSERTDEB_BELOWEQ_ | ( | __A, | |
__B | |||
) | while (0){} |
Definition at line 197 of file exceptions.h.
#define ASSERTDEB_EQUAL_ | ( | __A, | |
__B | |||
) | while (0){} |
Definition at line 193 of file exceptions.h.
#define ASSERTDEB_NOT_EQUAL_ | ( | __A, | |
__B | |||
) | while (0){} |
Definition at line 194 of file exceptions.h.
#define ASSERTDEBMSG_ | ( | f, | |
__ERROR_MSG | |||
) | while (0){} |
Definition at line 192 of file exceptions.h.
#define ASSERTMSG_ | ( | f, | |
__ERROR_MSG | |||
) |
Defines an assertion mechanism.
Definition at line 109 of file exceptions.h.
#define MRPT_CHECK_NORMAL_NUMBER | ( | v | ) |
Throws an exception if the number is NaN, IND, or +/-INF, or return the same number otherwise.
Definition at line 126 of file exceptions.h.
#define MRPT_END MRPT_TRY_END |
Definition at line 246 of file exceptions.h.
#define MRPT_END_WITH_CLEAN_UP | ( | stuff | ) | MRPT_TRY_END_WITH_CLEAN_UP(stuff) |
Definition at line 248 of file exceptions.h.
#define MRPT_PROFILE_FUNC_START |
Definition at line 235 of file exceptions.h.
#define MRPT_START |
Definition at line 242 of file exceptions.h.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION | ( | __V | ) |
For use in CSerializable implementations.
Definition at line 98 of file exceptions.h.
#define MRPT_TRY_END |
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an exception.
Definition at line 214 of file exceptions.h.
#define MRPT_TRY_END_WITH_CLEAN_UP | ( | stuff | ) |
The end of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an exception, including a "clean up" piece of code to be run before throwing the exceptions.
Definition at line 225 of file exceptions.h.
#define MRPT_TRY_START |
The start of a standard MRPT "try...catch()" block that allows tracing throw the call stack after an exception.
Definition at line 207 of file exceptions.h.
#define THROW_EXCEPTION | ( | msg | ) | THROW_TYPED_EXCEPTION(msg, std::logic_error) |
msg | This can be a char*, a std::string, or a literal string. Defines a unified way of reporting exceptions |
Definition at line 68 of file exceptions.h.
#define THROW_EXCEPTION_FMT | ( | _FORMAT_STRING, | |
... | |||
) | THROW_EXCEPTION(mrpt::format(_FORMAT_STRING, __VA_ARGS__)) |
Definition at line 70 of file exceptions.h.
#define THROW_STACKED_EXCEPTION |
Definition at line 80 of file exceptions.h.
#define THROW_STACKED_EXCEPTION_CUSTOM_MSG2 | ( | stuff, | |
param1 | |||
) |
Definition at line 91 of file exceptions.h.
#define THROW_TYPED_EXCEPTION | ( | msg, | |
exceptionClass | |||
) |
Definition at line 59 of file exceptions.h.
#define THROW_TYPED_EXCEPTION_FMT | ( | exceptionClass, | |
_FORMAT_STRING, | |||
... | |||
) |
Definition at line 73 of file exceptions.h.
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 |