2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef GIMBAL_C_CLOSURE_H
19#define GIMBAL_C_CLOSURE_H
24
25
26
28#define GBL_C_CLOSURE(self) (GBL_CAST(GblCClosure, self))
30#define GBL_C_CLOSURE_GET_CLASS(self) (GBL_CLASSOF(GblCClosure, self))
33#define GBL_SELF_TYPE GblCClosure
38
39
40
41
42
43
44
48
49
50
51
52
53
54
55
56
57
68
69
70
71
82
83
84
85
GblType GblCClosure_type(void)
Returns the GblType UUID for GblCClosure.
#define GBL_CLASS_CAST(cType, klass)
#define GBL_TYPEID(instanceStruct)
#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
#define GBL_PRIVATE_BEGIN
#define GBL_CLASS_DERIVE_EMPTY(...)
#define GBL_PRIVATE_END
Private data structure.
#define GBL_CLASSOF(cType, self)
#define GBL_CAST(cType, self)
void(* GblFnPtr)()
Type used for holding an untyped function pointer.
uint16_t GblRefCount
Type able to hold a reference counter across the codebase.
Closure type for invoking C functions.
GblRefCount GblCClosure_unref(GblCClosure *pSelf)
Releases the reference to the given GblCClosure, destroying it upon hitting zero.
void GblCClosure_setCallback(GblCClosure *pSelf, GblFnPtr pFnCallback)
Sets the C callback function of the given GblCClosure instance.
GblFnPtr pFnCallback
PRIVATE: C Function pointer to invoke as a callback.
GblFnPtr GblCClosure_callback(const GblCClosure *pSelf)
Returns the C callback function of the given GblClosure instance.
GblCClosure * GblCClosure_ref(GblCClosure *pSelf)
Creates and returns a new reference to the given GblCClosure, incrementing its refcount.
GblCClosure * GblCClosure_create(GblFnPtr pFnCallback, void *pUserdata)
Creates a GblCClosure instance with the given callback and userdata, returning a pointer to it.