![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Exception utilities for dfx (source-location aware exceptions, nested stacks, and safe invocation helpers). More...
Go to the source code of this file.
Classes | |
| class | dfx::Utils::Exception |
Runtime error that captures a std::source_location. More... | |
Macros | |
| #define | CURRENT_SOURCE_LOCATION std::source_location::current() |
| Expands to std::source_location::current(). | |
| #define | THROW_NESTED(msg, ...) |
| Throw an dfx::Utils::Exception nested within the currently handled exception. | |
| #define | THROW(msg, ...) |
| Throw an dfx::Utils::Exception with the current source location. | |
| #define | B_ASSERT(expr, msg, ...) |
| Assert-like check that throws an dfx::Utils::Exception on failure. | |
Typedefs | |
| using | dfx::Utils::ExceptionStack = std::vector<Exception> |
| Convenience alias for a linearized nested exception chain. | |
Functions | |
| template<typename T> | |
| constexpr bool | dfx::Utils::__b_assert_expr (T &&expr) |
| Helper used by B_ASSERT to validate and evaluate the asserted expression. | |
| template<typename F, typename ... Args> requires std::invocable<F, Args...> | |
| auto | dfx::Utils::safeInvoke (std::shared_ptr< spdlog::logger > logger, F &&f, Args &&... args) noexcept |
| Invoke a callable and catch/log all exceptions. | |
| template<typename F, typename ... Args> requires std::invocable<F, Args...> | |
| auto | dfx::Utils::safeInvoke (std::string const &loggerName, F &&f, Args &&... args) noexcept |
| Convenience overload of safeInvoke using a logger name. Internally resolves the logger via spdlog::get(loggerName) and then calls the logger-pointer overload. | |
Exception utilities for dfx (source-location aware exceptions, nested stacks, and safe invocation helpers).
| #define B_ASSERT | ( | expr, | |
| msg, | |||
| ... ) |
Assert-like check that throws an dfx::Utils::Exception on failure.
Unlike assert(), this is always active (no NDEBUG semantics) and throws instead of aborting.
| #define CURRENT_SOURCE_LOCATION std::source_location::current() |
Expands to std::source_location::current().
| #define THROW | ( | msg, | |
| ... ) |
Throw an dfx::Utils::Exception with the current source location.
| #define THROW_NESTED | ( | msg, | |
| ... ) |
Throw an dfx::Utils::Exception nested within the currently handled exception.
Must be used from within a catch block.