|
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 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 81 of file gimbal_closure.h.
|
Sets the closure's marshal to the function pointed to by pFnMarshal.
|
Sets the closure's class's meta marshal to the function pointed to by pFnMeta, swizzling its class.
|
Returns whether the GblClosure has an instance marshal or not.
|
Returns whether the GblClosure's class has a meta marshal or not.
|
Invokes the given GblClosure, marshalling args in and a value out as variants.
| GblClosureClass* GblClosure::pClass |
Pointer to class/vtable structure.
Definition at line 81 of file gimbal_closure.h.
| GblBox GblClosure::base |
Inherited base instance structure.
Definition at line 81 of file gimbal_closure.h.
| GblMarshalFn GblClosure::pFnMarshal |
Per-instance marshal function, private.
Definition at line 83 of file gimbal_closure.h.