libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
#include <gimbal_closure.h>
Data Fields | ||
union { | ||
GblClosureClass * pClass | ||
GblBox base | ||
}; | ||
struct { | ||
GblMarshalFn pFnMarshal | ||
} | private_ | |
Data Fields inherited from GblBox | ||
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 | |
Base instance for all closure types.
A GblClosure represents an abstract generic callback object. It is analogous to a stateful C++ function object, or functor, in that it can contain both a callback method as well as stateful data to operate upon.
All closures have a single entry-point for having their callback logic called, which is GblClosure_invoke(). This calls the closure's "marshal" function, which is responsible for
As the abstract base closure, there is no underlying language-specific callback state within this class. For calling back into C function pointers, see GblCClosure.
Definition at line 88 of file gimbal_closure.h.
|
related |
Sets the closure's marshal to the function pointed to by pFnMarshal
.
|
related |
Sets the closure's class's meta marshal to the function pointed to by pFnMeta
, swizzling its class.
|
related |
Returns whether the GblClosure has an instance marshal or not.
|
related |
Returns whether the GblClosure's class has a meta marshal or not.
|
related |
Invokes the given GblClosure, marshalling args in and a value out as variants.
|
related |
Definition at line 147 of file gimbal_closure.h.
GblClosureClass* GblClosure::pClass |
Pointer to class/vtable structure.
Definition at line 88 of file gimbal_closure.h.
GblBox GblClosure::base |
Inherited base instance structure.
Definition at line 88 of file gimbal_closure.h.
GblMarshalFn GblClosure::pFnMarshal |
Per-instance marshal function, private.
Definition at line 90 of file gimbal_closure.h.