MkObjectC - create and destroy a managed-object … More...
Macros | |
#define | MkObjInit2(rtmkV, rtExtV, sigV, typeV, refCountV, isLocalV) |
Initialize an MkObjectS. | |
#define | MkObjInit(rtmkV, rtExtV, cls, refCountV, isLocalV) |
#define | MkObjInitFromType(typeV, isLocalV) |
#define | MkObjInitFromInstance(instV) |
#define | MkObjectDelete_NULL(obj) |
#define | MkObjectDelete_NULL_X(x) |
#define | MkObjectDelete_1X(x) |
#define | MkObjectDeleteToNull(fct, NS, x) |
#define | MkObjectDeleteToNull_X(fct, NS, x) |
#define | MkObjectDispose_NULL(obj) |
#define | MkObjectDispose_NULL_X(x) |
#define | MkObjectDispose_1X(x) |
#define | MkObjectDeleteCallF_CHECK |
validate call to MkObjectDeleteCallF | |
#define | MkObjectDeleteCallF_ARGS MK_RT_ARGS MK_OBJ const obj, MK_CBP const __data__ |
the MkObjectDeleteCallF arguments with default names | |
#define | MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__ |
the MkObjectDeleteCallF arguments CALL with default names | |
#define | MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP |
the MkObjectDeleteFreeF arguments with default names | |
Typedefs | |
typedef enum MkErrorE(* | MkObjectDeleteCallF) (MkObjectDeleteCallF_ARGS) |
static callback | |
typedef void(* | MkObjectDeleteFreeF) (MkObjectDeleteFreeF_ARGS) |
Functions | |
MK_EXTERN MK_OBJ | MkObjDup_RT (MK_RT mkrt, MK_OBJ const srcobj) |
call the Dup-Constructor from the object | |
MK_EXTERN MK_OBJ | MkObjDup2_RT (MK_RT mkrt, MK_OBJ const srcmng, MK_STRN const ident) |
call the Dup2-Constructor from the object | |
MK_EXTERN MK_OBJ | MkObjMerge_RT (MK_RT mkrt, MK_OBJ const obj) |
Constructor - create a new object as a merge from an existing object | |
MK_EXTERN MK_OBJ | MkObjCreate_RT (MK_RT mkrt, MK_TYP type, MK_PTR nat, MK_PTR lnk) |
call the Constructor from the object | |
MK_EXTERN void | MkObjectDelete_RT (MK_RT mkrt, MK_OBJ obj) |
Delete-Slot - delete an instance. | |
MK_EXTERN void | MkObjectDispose_RT (MK_RT mkrt, MK_OBJ obj) |
Dispose-Slot - untie the connection between the Native-C-Instance and the libmkkernel-Instance. | |
MK_EXTERN enum MkErrorE | MkObjectDeleteCallbackSetup_RT (MK_RT mkrt, MK_STRN ident, MkObjectDeleteCallF fCall, MK_CBP callback, MkObjectDeleteFreeF fFree, MK_STRN filter) |
Create/Delete the instance-delete-callback … | |
MK_EXTERN void | MkObjectDeleteCallbackCleanup_RT (MK_RT mkrt, MK_STRN ident) |
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup … | |
MkObjectC - MkObjectC_TOR_C_API - overload | |
#define | MkObjCreate_NULL(...) |
#define | MkObjCreate(...) |
#define | MkObjCreate_2(nat, lnk) |
#define | MkObjectDispose(x) |
#define | MkObjectDelete(x) |
#define | MkObjDup_NULL(...) |
#define | MkObjDup(...) |
#define | MkObjDup2_NULL(...) |
#define | MkObjDup2(...) |
#define | MkObjMerge_NULL(...) |
#define | MkObjMerge(...) |
#define | MkObjectDeleteCallbackCleanup_NULL(...) |
#define | MkObjectDeleteCallbackCleanup(...) |
#define | MkObjectDeleteCallbackSetup_NULL(...) |
#define | MkObjectDeleteCallbackSetup(...) |
#define | MkObjectDeleteCallbackSetup_E(...) |
#define | MkObjectDeleteCallbackSetup_C(...) |
MkObjectC - create and destroy a managed-object …
#define MkObjCreate | ( | ... | ) |
Definition at line 1721 of file kernel_overload_mk.h.
#define MkObjCreate_2 | ( | nat, | |
lnk ) |
Definition at line 1722 of file kernel_overload_mk.h.
#define MkObjCreate_NULL | ( | ... | ) |
Definition at line 1720 of file kernel_overload_mk.h.
#define MkObjDup | ( | ... | ) |
Definition at line 1732 of file kernel_overload_mk.h.
#define MkObjDup2 | ( | ... | ) |
Definition at line 1734 of file kernel_overload_mk.h.
#define MkObjDup2_NULL | ( | ... | ) |
Definition at line 1733 of file kernel_overload_mk.h.
#define MkObjDup_NULL | ( | ... | ) |
Definition at line 1731 of file kernel_overload_mk.h.
#define MkObjectDelete | ( | x | ) |
Definition at line 1728 of file kernel_overload_mk.h.
#define MkObjectDelete_1X | ( | x | ) |
Definition at line 4045 of file LibMkKernel_mk.h.
#define MkObjectDelete_NULL | ( | obj | ) |
Definition at line 4043 of file LibMkKernel_mk.h.
#define MkObjectDelete_NULL_X | ( | x | ) |
Definition at line 4044 of file LibMkKernel_mk.h.
#define MkObjectDeleteCallbackCleanup | ( | ... | ) |
Definition at line 1740 of file kernel_overload_mk.h.
#define MkObjectDeleteCallbackCleanup_NULL | ( | ... | ) |
Definition at line 1739 of file kernel_overload_mk.h.
#define MkObjectDeleteCallbackSetup | ( | ... | ) |
Definition at line 1742 of file kernel_overload_mk.h.
#define MkObjectDeleteCallbackSetup_C | ( | ... | ) |
Definition at line 1744 of file kernel_overload_mk.h.
#define MkObjectDeleteCallbackSetup_E | ( | ... | ) |
Definition at line 1743 of file kernel_overload_mk.h.
#define MkObjectDeleteCallbackSetup_NULL | ( | ... | ) |
Definition at line 1741 of file kernel_overload_mk.h.
#define MkObjectDeleteCallF_ARGS MK_RT_ARGS MK_OBJ const obj, MK_CBP const __data__ |
the MkObjectDeleteCallF arguments with default names
Definition at line 4083 of file LibMkKernel_mk.h.
#define MkObjectDeleteCallF_CALL MK_RT_CALL obj, __data__ |
the MkObjectDeleteCallF arguments CALL with default names
Definition at line 4085 of file LibMkKernel_mk.h.
#define MkObjectDeleteCallF_CHECK |
validate call to MkObjectDeleteCallF
Definition at line 4076 of file LibMkKernel_mk.h.
#define MkObjectDeleteFreeF_ARGS MK_RT_ARGS MK_CBP *dataP |
the MkObjectDeleteFreeF arguments with default names
Definition at line 4091 of file LibMkKernel_mk.h.
#define MkObjectDeleteToNull | ( | fct, | |
NS, | |||
x ) |
Definition at line 4047 of file LibMkKernel_mk.h.
#define MkObjectDeleteToNull_X | ( | fct, | |
NS, | |||
x ) |
Definition at line 4048 of file LibMkKernel_mk.h.
#define MkObjectDispose | ( | x | ) |
Definition at line 1725 of file kernel_overload_mk.h.
#define MkObjectDispose_1X | ( | x | ) |
Definition at line 4073 of file LibMkKernel_mk.h.
#define MkObjectDispose_NULL | ( | obj | ) |
Definition at line 4071 of file LibMkKernel_mk.h.
#define MkObjectDispose_NULL_X | ( | x | ) |
Definition at line 4072 of file LibMkKernel_mk.h.
#define MkObjInit | ( | rtmkV, | |
rtExtV, | |||
cls, | |||
refCountV, | |||
isLocalV ) |
Definition at line 3937 of file LibMkKernel_mk.h.
#define MkObjInit2 | ( | rtmkV, | |
rtExtV, | |||
sigV, | |||
typeV, | |||
refCountV, | |||
isLocalV ) |
Initialize an MkObjectS.
This is internal code used in the CTOR toinitialize the memory after the new object was created.
Definition at line 3900 of file LibMkKernel_mk.h.
#define MkObjInitFromInstance | ( | instV | ) |
Definition at line 3945 of file LibMkKernel_mk.h.
#define MkObjInitFromType | ( | typeV, | |
isLocalV ) |
Definition at line 3941 of file LibMkKernel_mk.h.
#define MkObjMerge | ( | ... | ) |
Definition at line 1736 of file kernel_overload_mk.h.
#define MkObjMerge_NULL | ( | ... | ) |
Definition at line 1735 of file kernel_overload_mk.h.
typedef enum MkErrorE( * MkObjectDeleteCallF) (MkObjectDeleteCallF_ARGS) |
static callback
Definition at line 4066 of file LibMkKernel_mk.h.
typedef void( * MkObjectDeleteFreeF) (MkObjectDeleteFreeF_ARGS) |
Definition at line 4093 of file LibMkKernel_mk.h.
call the Constructor from the object
Create a new object using type and an additional nat. This requie a MkTypeS::constructor be available
call the Dup2-Constructor from the object
The Dup2-Constructor create a new object-shell, and copy all the internal data from the srcobj to the newobj. An additional ident is used to set e name ressource After the Dup2-Constructor the srcobj is unchanged.
MK_NULL
if no Dup2-Constructor failscall the Dup-Constructor from the object
This is an Instance-Callback the real Dup function called depend on the MkObjectS::type.
The Dup-Constructor create a new object-shell, and copy all the internal data from the srcobj to the newobj. After the Dup-Constructor the srcobj is unchanged.
The new instance belongs to the caller and may have to be released if necessary. A manual release using ObjectDelete is always possible, but the instance can no longer be used afterwards.
Delete-Slot - delete an instance.
There are two different ways to delete an instance:
ObjectDispose | to free the internal data but keep the outher shell alive - this is called a SOFT-DELETE |
ObjectDelete | to delete the outher shell including the internal data - this is called a HARD-DELETE |
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup …
MK_EXTERN enum MkErrorE MkObjectDeleteCallbackSetup_RT | ( | MK_RT | mkrt, |
MK_STRN | ident, | ||
MkObjectDeleteCallF | fCall, | ||
MK_CBP | callback, | ||
MkObjectDeleteFreeF | fFree, | ||
MK_STRN | filter ) |
Create/Delete the instance-delete-callback …
The callback is called shortly before deleting an instance and is used to synchronize object management across the network.
The ident identifies the callback
ALL
is used than all callbacks are deleted first.The fCall (C-Only) or callback (Non-C) it is the callback called
MK_NULL
than the callback with name ident is deleted if exists and no new callback is created. MK_NULL
then it is identical to MkObjectDeleteCallbackCleanup(ident).The filter is a POSIX Extended Regular Expression to filter on type-names.
MK_NULL
and not ""
: MkBufferC
. man 7 regex
. [in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | ident | Identify the callback, have to ne non MK_NULL and not "" . |
[in] | fCall | (C-Only) Internal required: the callback, if MK_NULL than the callback is deleted. |
[in] | callback | Optional: the parameter for fcall, for cleanup use fFree. |
[in] | fFree | (C-Only) Internal optional: cleanup callback data |
[in] | filter | Optional: is an regular expression to filter for MkTypeS::type_name. |
MkObjectDeleteCallbackSetup
: callback signatureMkObjectDeleteCallbackSetup
: callback exampleDispose-Slot - untie the connection between the Native-C-Instance and the libmkkernel-Instance.
There are two different ways to delete an instance:
ObjectDispose | to free the internal data but keep the outher shell alive - this is called a SOFT-DELETE |
ObjectDelete | to delete the outher shell including the internal data - this is called a HARD-DELETE |
Constructor - create a new object as a merge from an existing object
The Merge-Constructor create a new object-shell, and take-over all the internal data from the source-object. After the Merge-Constructor the source-object is empty as if a object-reset was called.
One usage of the Merge-Constructor is to get a lightweight-copy of a Thread-Local-Storage object for external usage.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | The source-object of the merge. |
MK_NULL
if no Merge-Constructor is available