libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
Go to the source code of this file.
Data Structures | |
struct | GblExceptionClass |
struct | GblException |
Macros | |
Type System | |
Type UUID and cast operators | |
#define | GBL_EXCEPTION_TYPE |
#define | GBL_EXCEPTION(self) |
#define | GBL_EXCEPTION_CLASS(klass) |
#define | GBL_EXCEPTION_GET_CLASS(self) |
DSL Macros | |
Macros for managing exceptions and control flow
| |
#define | GBL_TRY |
#define | GBL_THROW(type, ...) |
#define | GBL_CATCH |
#define | GBL_CATCH_AS(type, name) |
Functions | |
GblType | GblException_type (void) |
Static Methods | |
Static methods for managing a thread's active exception | |
GblException * | GblException_current (void) |
GblBool | GblException_clear (void) |
GblException * | GblException_catch (GblType type) |
void | GblException_throw (GblException *pErr) |
GblException object-oriented error type.
This file contains the API for GblException, an extensible, object-oriented error type, similar to exceptions seen in languages such as C++, C#, and Java.
Unlike GblError, which is minimalistic and lightweight, GblException provides more flexibility for error data at the price of being heavier. It's better suited for errors which need to carry additional data payloads beyond just an error code and a message.
Definition in file gimbal_exception.h.
#define GBL_EXCEPTION_TYPE |
Type UUID for GblException.
Definition at line 34 of file gimbal_exception.h.
#define GBL_EXCEPTION | ( | self | ) |
Casts a GblInstance to GblException.
Definition at line 35 of file gimbal_exception.h.
#define GBL_EXCEPTION_CLASS | ( | klass | ) |
Casts a GblClass to GblExceptionClass.
Definition at line 36 of file gimbal_exception.h.
#define GBL_EXCEPTION_GET_CLASS | ( | self | ) |
Retrieves a GblExceptionClass from a GblInstance.
Definition at line 37 of file gimbal_exception.h.
#define GBL_TRY |
Definition at line 45 of file gimbal_exception.h.
#define GBL_THROW | ( | type, | |
... | |||
) |
Definition at line 46 of file gimbal_exception.h.
#define GBL_CATCH |
Definition at line 47 of file gimbal_exception.h.
#define GBL_CATCH_AS | ( | type, | |
name | |||
) |
Definition at line 48 of file gimbal_exception.h.
GblType GblException_type | ( | void | ) |
Returns the GblType UUID corresponding to GblException.
GblException * GblException_current | ( | void | ) |
Returns a pointer to the current thread's pending GblException or NULL if there isn't one.
GblBool GblException_clear | ( | void | ) |
Clears the current thread's active GblException, returning GBL_TRUE if it had one.
GblException * GblException_catch | ( | GblType | type | ) |
Takes ownership of the current thread's active GblException if it matches type
, otherwise returns NULL.
void GblException_throw | ( | GblException * | pErr | ) |
Sets the given GblException as the current thread's active exception, taking ownership of it.