libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
#include <gimbal_box.h>
Data Fields | ||
union { | ||
GblBoxClass * pClass | ||
GblInstance base | ||
}; | ||
struct { | ||
GblArrayMap * pFields | ||
volatile uint16_t refCounter | ||
uint16_t contextType: 1 | ||
uint16_t constructedInPlace: 1 | ||
uint16_t derivedFlags: 14 | ||
} | private_ | |
Data Fields inherited from GblInstance | ||
GblClass * | pClass | |
Related Symbols | |
(Note that these are not member symbols.) | |
Reference Counting | |
Methods for managing shared reference lifetime | |
GblBox * | GblBox_ref (GblBox *pSelf) |
GblRefCount | GblBox_unref (GblBox *pSelf) |
GblRefCount | GblBox_refCount (const GblBox *pSelf) |
Userdata | |
Methods for managing and destroying userdata | |
void * | GblBox_userdata (const GblBox *pSelf) |
GBL_RESULT | GblBox_setUserdata (GblBox *pSelf, void *pUserdata) |
GBL_RESULT | GblBox_setUserDestructor (GblBox *pSelf, GblArrayMapDtorFn pFnUdDtor) |
Fields | |
Methods for managing extended userdata fields | |
uintptr_t | GblBox_field (const GblBox *pSelf, GblQuark key) |
uintptr_t | GblBox_takeField (GblBox *pSelf, GblQuark key) |
GblBool | GblBox_clearField (GblBox *pSelf, GblQuark key) |
GblBool | GblBox_hasField (const GblBox *pSelf, GblQuark key) |
GBL_RESULT | GblBox_setField (GblBox *pSelf, GblQuark key, uintptr_t ud, GblArrayMapDtorFn pFnDtor) |
Related Symbols inherited from GblInstance | |
GblRefCount | GblInstance_destroy (GblInstance *pSelf) |
#define | GBL_TYPEOF(self) |
#define | GBL_PRIVATE(cType, self) |
#define | GBL_PUBLIC(cType, selfPriv) |
#define | GBL_TYPECHECK(cType, self) |
#define | GBL_CAST(cType, self) |
#define | GBL_AS(cType, self) |
#define | GBL_CLASSOF(cType, self) |
#define | GBL_CLASSOF_AS(cType, self) |
#define | GBL_VCALL(cType, method, ...) |
#define | GBL_VCALL_DEFAULT(cType, method, ...) |
GblBool | GblInstance_check (const GblInstance *pSelf, GblType toType) |
GblInstance * | GblInstance_cast (GblInstance *pSelf, GblType toType) |
GblInstance * | GblInstance_as (GblInstance *pSelf, GblType toType) |
void * | GblInstance_private (const GblInstance *pSelf, GblType base) |
GblInstance * | GblInstance_public (const void *pPriv, GblType base) |
GblType | GblInstance_typeOf (const GblInstance *pSelf) |
size_t | GblInstance_size (const GblInstance *pSelf) |
size_t | GblInstance_privateSize (const GblInstance *pSelf) |
size_t | GblInstance_totalSize (const GblInstance *pSelf) |
GblClass * | GblInstance_class (const GblInstance *pSelf) |
GBL_RESULT | GblInstance_swizzleClass (GblInstance *pSelf, GblClass *pClass) |
GBL_RESULT | GblInstance_sinkClass (GblInstance *pSelf) |
GBL_RESULT | GblInstance_floatClass (GblInstance *pSelf) |
Minimally bindable GblInstance with reference semantics and opaque userdata.
A GblBox is a GblInstance-derived type which simply adds the bare minimal set of functionality that is typically required for language bindings and interop. This includes:
Definition at line 83 of file gimbal_box.h.
Increments the given GblBox's reference count by 1, returning a pointer to it.
|
related |
Decrements the given GblBox's reference count by 1, destructing it when it hits 0.
|
related |
Returns the number of active references held to the given GblBox.
|
related |
Returns the userdata pointer stored within the given GblBox.
|
related |
Stores the untyped userdata pointer within the GblBox.
|
related |
Sets an additional user destructor to be invoked with the GblBox passed back to it when its being destructed.
Returns the generic userdata field value for the given GblBox associated with the key.
Extracts the generic userdata field value for the given key, without destroying it.
Clears the field value for the given key, if it exists, calling its destructor (if it has one) and returning GBL_TRUE.
Returns GBL_TRUE if there is a field value on the given GblBox corresponding to the key.
|
related |
Inserts ud
into the the GblBox with the given key
and optional destructor, destroying any overwritten value.
GblBoxClass* GblBox::pClass |
Pointer to class/vtable structure.
Definition at line 83 of file gimbal_box.h.
GblInstance GblBox::base |
Inherited base GblBox structure.
Definition at line 83 of file gimbal_box.h.
GblArrayMap* GblBox::pFields |
PRIVATE: Storage for extended userdata fields.
Definition at line 85 of file gimbal_box.h.
volatile uint16_t GblBox::refCounter |
PRIVATE: Atomic reference counter.
Definition at line 86 of file gimbal_box.h.
uint16_t GblBox::contextType |
uint16_t GblBox::constructedInPlace |
PRIVATE: Flag for whether memory is deallocated upon destruction.
Definition at line 88 of file gimbal_box.h.
uint16_t GblBox::derivedFlags |
PRIVATE: Extra flags for use in derived classes.
Definition at line 89 of file gimbal_box.h.