Contexts and Errors¶
-
class Context¶
Container for UNIT’s state. This type cannot be implicitly copied.
This is a wrapper around
UNIT_Context.-
Context()¶
Initialize a context. This calls
UNIT_Context_Init()internally.Quirk
On failure, this raises a
std::runtime_exceptioninstead of aunit::error.
-
UNIT_Context *raw()¶
Get the raw
UNIT_Contextthat this class is wrapping.
-
Context()¶
-
enum class ErrorCode¶
Scoped wrapper around
UNIT_ErrorCode. Values in this enum are guaranteed to be equivalent to their C counterpart (and thus statically casting this enum toUNIT_ErrorCodeis safe).
-
class error : public std::runtime_exception¶
Wrapper around UNIT’s error API as a C++ exception. Functions that return
UNIT_Statusin UNIT’s C API will raise this exception from their C++ counterpart.-
error(UNIT_Context *ctx)¶
- Parameters:
ctx – The raw
UNIT_Contextin which the error originated.
-
error(UNIT_Context *ctx)¶