GATE
Loading...
Searching...
No Matches
runnables.h File Reference

Encapsulation of executable codes by runnable interface. More...

#include "gate/gate_core_api.h"
#include "gate/delegates.h"
#include "gate/objects.h"
#include "gate/synchronization.h"

Functions

GATE_CORE_API gate_runnable_tgate_runnable_dispatcher_create (void *func_ptr, gate_size_t func_ptr_size, gate_runnable_dispatcher_t dispatcher,...)
 Creates a.
 

Detailed Description

Encapsulation of executable codes by runnable interface.

Function Documentation

◆ gate_runnable_dispatcher_create()

GATE_CORE_API gate_runnable_t * gate_runnable_dispatcher_create ( void * func_ptr,
gate_size_t func_ptr_size,
gate_runnable_dispatcher_t dispatcher,
... )

Creates a.

See also
gate_runnable_t object from a target function, a dispatcher and pairs

This function stores all given arguments in a runnable object and uses a dispatcher function generated by GATE_RUNNABLE_DISPATCHER_DECLARE_N() to invoke a target function with the preserved arguments.

Parameters
[in]func_ptrPointer to target function pointer to be called by runnable instance
[in]func_ptr_sizeSize of target function pointer to be called
[in]dispatcherPointer to dispatcher function that calls target function with stored parameters
[in]...Pairs of pointers to arguments and their sizes, e.g.: (int)1, sizeof(int), "hello", sizeof(char const*)
Returns
pointer to allocated gate_runnable_t instance, or NULL in case of allocation failure