2
3
4
5
6
7
8
9
10
11
12
13#ifndef GIMBAL_CLASS_CLOSURE_H
14#define GIMBAL_CLASS_CLOSURE_H
18#define GBL_CLASS_CLOSURE_TYPE (GBL_TYPEID(GblClassClosure))
20#define GBL_CLASS_CLOSURE(self) (GBL_CAST(GblClassClosure, self))
21#define GBL_CLASS_CLOSURE_CLASS(klass) (GBL_CLASS_CAST(GblClassClosure, self))
22#define GBL_CLASS_CLOSURE_GET_CLASS(self) (GBL_CLASSOF(GblClassClosure, self))
24#define GBL_SELF_TYPE GblClassClosure
29
30
31
32
36
37
38
39
40
41
42
57 GblInstance* pInstance,
61
62
63
64
#define GBL_CLASS_CAST(cType, klass)
GblClassClosure * GblClassClosure_create(GblType classType, size_t offset, GblInstance *pInstance, void *pUserdata)
Creates a new GblClassClosure with the given values, returning a pointer to it.
GblType GblClassClosure_type(void)
Returns the GblType UUID associated with GblClassClosure.
#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)
GblClosure type for calling into virtual methods.
GblType classType
PRIVATE: Type of class to invoke the method on.
size_t offset
PRIVATE: Offset of the virtual function to invoke.
void GblClassClosure_setInstance(GblClassClosure *pSelf, GblInstance *pInstance)
Sets the GblInstance to call the GblClass virtual method on.
GblInstance * pInstance
PRIVATE: Instance to invoke the class method on.
void GblClassClosure_setMethod(GblClassClosure *pSelf, GblType classType, size_t offset)
Sets the offset of the virtual method pointer into the GblClass to invoke the closure on.