GATE
|
C object class definition functions and macros. More...
Macros | |
#define | gate_object_get_interface_name(obj) |
See gate_object_t::get_interface_name. | |
#define | gate_object_release(obj) |
See gate_object_t::release. | |
#define | gate_object_retain(obj) |
See gate_object_t::retain. | |
#define | gate_runnable_run(obj) |
See gate_runnable_t::run. | |
#define | gate_cloneable_clone(obj, ptrnewclone) |
See gate_clonable_t::clone. | |
#define | gate_startable_start(obj) |
See gate_startable_t::start. | |
#define | gate_startable_stop(obj) |
See gate_startable_t::stop. | |
#define | gate_startable_get_status(obj) |
See gate_startable_t::get_status. | |
#define | GATE_OBJECT_IMPLEMENTS(obj, interface_name) |
Macro that cast any obj pointer into gate_object_t* and invokes gate_object_implements_interface . | |
Typedefs | |
typedef gate_object_t * | gate_object_ptr_t |
Functions | |
GATE_CORE_API gate_runnable_t * | gate_runnable_create (gate_entrypoint_t function, void *param, gate_size_t param_length, gate_mem_copyctor_t param_constructor, gate_mem_dtor_t param_destructor) |
Creates a gate_runnable_t interface covering an executable function and a user defined parameter. | |
GATE_CORE_API gate_memoryblock_t * | gate_memoryblock_create (size_t data_length) |
Creates a new memory block. | |
GATE_CORE_API gate_result_t | gate_object_ptr_copyctor (void *dest, void const *src) |
Object-pointer copy constructor function. | |
GATE_CORE_API void | gate_object_ptr_dtor (void *dest) |
Object-pointer destructor function. | |
GATE_CORE_API gate_bool_t | gate_object_implements_interface (gate_object_t *obj, char const *interface_name) |
Evaluates if an object implements a specific interface. | |
C object class definition functions and macros.
typedef gate_object_t* gate_object_ptr_t |
Pointer to gate_object_t interface
GATE_CORE_API gate_runnable_t * gate_runnable_create | ( | gate_entrypoint_t | function, |
void * | param, | ||
gate_size_t | param_length, | ||
gate_mem_copyctor_t | param_constructor, | ||
gate_mem_dtor_t | param_destructor ) |
Creates a gate_runnable_t
interface covering an executable function and a user defined parameter.
[in] | function | Entrypoint function pointer with code to be executed |
[in] | param | Pointer to user defined parameter for entry point |
[in] | param_length | Length of data in param in bytes |
[in] | param_constructor | Optional copy-constructor function to copy user-defined data, NULL uses gate_mem_copy() |
[in] | param_destructor | Optional destructor function to release user-defined data |
gate_runnable_t
instance, or NULL in case of allocation error GATE_CORE_API gate_result_t gate_object_ptr_copyctor | ( | void * | dest, |
void const * | src ) |
Object-pointer copy constructor function.
Creates a copy of an object pointer and increases the object's reference count
[out] | dest | Pointer to object-pointer (gate_object_t**) that receives the new object reference |
[in] | src | Pointer to object-pointer (gate_object_t* const*) holding the source object reference |
GATE_CORE_API void gate_object_ptr_dtor | ( | void * | dest | ) |
Object-pointer destructor function.
decreases the reference count of the referenced object and sets the pointer to NULL
[out] | dest | Pointer to object-pointer (gate_object_t**) that will be released |
GATE_CORE_API gate_bool_t gate_object_implements_interface | ( | gate_object_t * | obj, |
char const * | interface_name ) |
Evaluates if an object implements a specific interface.
[in] | obj | Pointer to object to be evaluated |
[in] | interface_name | Pointer to object interface string name |
object
implements the interface specified in interface_name