MkObjectC - managed-object details More...
Functions | |
MK_OBJ | libmkkernel::MkObjCopy_RT (MK_RT mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng) |
call the copy from the object | |
MK_OBJ | libmkkernel::MkObjReset_RT (MK_RT mkrt, MK_OBJ const obj) |
free the internal memory of an object and initialize the local variables to default values | |
MkSelf | |
typedef void(* | libmkkernel::MkSelfIncrF) (MK_RT mkrt, MK_PTR self, MK_PTR const env) |
typedef void(* | libmkkernel::MkSelfDecrF) (MK_RT mkrt, MK_PTR self, MK_PTR const env) |
static void | libmkkernel::MkSelfSet (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
set the MkObjectS::self value | |
static MK_PTR | libmkkernel::MkSelfGet (MK_OBJ const obj) |
get the MkObjectS::self value | |
static MK_ATTR_HOT enum MkErrorE | libmkkernel::MkSelfNew_RT (MK_RT mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env) |
return the self pointer for a given obj … | |
MK_PTR | libmkkernel::MkSelfCreate_RT (MK_RT mkrt, MK_OBJ const obj, MK_PTR const env) |
create the MkObjectS::self value | |
bool | libmkkernel::MkSelfDelete_RT (MK_RT mkrt, MK_OBJ const obj) |
delete the MkObjectS::self value | |
bool | libmkkernel::MkSelfDeleteForce_RT (MK_RT mkrt, MK_OBJ obj) |
force delete an instance, last step in instance-destructor | |
void | libmkkernel::MkSelfUnlink_RT (MK_RT mkrt, MK_OBJ obj) |
Run the MkTypeS::selfUnlink slot from the instance... | |
static bool | libmkkernel::MkSelfExists (MK_OBJN obj) |
Check if the MkObjectS::self exists … | |
#define | MkSelfSet_3X(x, self, env) |
#define | MkSelfGet_1X(x) |
#define | MkSelfNew_3X(x, self_out, env) |
#define | MkSelfCreate_2X(x, env) |
#define | MkSelfDelete_1X(x) |
#define | MkSelfDeleteForce_1X(x) |
#define | MkSelfUnlink_1X(x) |
#define | MkSelfExists_1X(x) |
MkRef… | |
reference management functions | |
static void | libmkkernel::MkRefIncr (MK_OBJ obj) |
increment the reference-count | |
void | libmkkernel::MkRefDecr_RT (MK_RT mkrt, MK_OBJ obj) |
decrement the reference-count | |
static void | libmkkernel::MkRefIncrSelf (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
ATOMIC operation -> link self with reference-count. | |
MK_OBJ | libmkkernel::MkRefDecrWithoutSelf_RT (MK_RT mkrt, MK_OBJ const obj) |
ATOMIC operation -> unlink self with reference-count. | |
MK_OBJ | libmkkernel::MkRefDecrWithUnlinkSelf_RT (MK_RT mkrt, MK_OBJ const obj) |
ATOMIC operation -> unlink self from META und decr-ref-count in META. | |
static MK_I32 | libmkkernel::MkRefGet (MK_OBJ const obj) |
get the reference-count | |
static MK_I32 | libmkkernel::MkRefLock (MK_OBJ const obj) |
lock the object | |
static bool | libmkkernel::MkRefIsLocked (MK_OBJ const obj) |
check if object is locked | |
MK_NUM | libmkkernel::MkRefCidN_RT (MK_RT mkrt) |
return the reference-count-recursion-level | |
#define | MkRefLOCK 999999 |
unchangeable reference | |
#define | MkRefIncr_1X(x) |
#define | MkRefIncr_1M(m) |
#define | MkRefIncr_FX(x) |
protect code-block, do not call the destructor… | |
#define | MkRefDecr_O(o) |
#define | MkRefDecr_X(x) |
#define | MkRefDecr_X_NULL(x) |
same as MkRefDecr_X but do not expect a runtime-cache. | |
#define | MkRefDecr_M(m) |
#define | MkRefDecr_M_NULL(m) |
same as MkRefDecr_M but do not expect a runtime-cache. | |
#define | MkRefDecr_FX(x) |
protect code-block, do not call the destructor… | |
#define | MkRefIncrSelf_2X(x, s) |
#define | MkRefGet_1X(x) |
#define | MkRefLock_1X(x) |
#define | MkRefIsLocked_1X(x) |
#define | MkRefSet(target, source) |
update target with source and keep the MkObjectS::refCount in sync | |
MkObjectC - MkObjectC_Obj_C_API - overload | |
#define | MkRefCidN_NULL() |
#define | MkObjCopy_NULL(...) |
#define | MkObjCopy(...) |
#define | MkObjReset_NULL(...) |
#define | MkObjReset(...) |
#define | MkRefDecrWithUnlinkSelf_NULL(...) |
#define | MkRefDecrWithUnlinkSelf(...) |
#define | MkRefDecrWithoutSelf_NULL(...) |
#define | MkRefDecrWithoutSelf(...) |
#define | MkSelfCreate_NULL(...) |
#define | MkSelfCreate(...) |
#define | MkSelfNew_NULL(...) |
#define | MkSelfNew(...) |
#define | MkSelfNew_E(...) |
#define | MkSelfNew_C(...) |
#define | MkRefCidN_NULL() |
#define | MkRefCidN() |
#define | MkRefDecr_NULL(...) |
#define | MkRefDecr(...) |
#define | MkSelfDelete_NULL(...) |
#define | MkSelfDelete(...) |
#define | MkSelfDeleteForce_NULL(...) |
#define | MkSelfDeleteForce(...) |
#define | MkSelfUnlink_NULL(...) |
#define | MkSelfUnlink(...) |
MkObjectC - managed-object details
Managed-Object-Technology (MOT) is a class system in C that is designed to integrate automatically into other software, which of course also includes other programming languages.
#define MkObjCopy | ( | ... | ) |
Definition at line 1673 of file kernel_overload_mk.h.
#define MkObjCopy_NULL | ( | ... | ) |
Definition at line 1672 of file kernel_overload_mk.h.
#define MkObjReset | ( | ... | ) |
Definition at line 1675 of file kernel_overload_mk.h.
#define MkObjReset_NULL | ( | ... | ) |
Definition at line 1674 of file kernel_overload_mk.h.
#define MkRefCidN | ( | ) |
Definition at line 1693 of file kernel_overload_mk.h.
#define MkRefCidN_NULL | ( | ) |
Definition at line 1692 of file kernel_overload_mk.h.
#define MkRefCidN_NULL | ( | ) |
Definition at line 4768 of file LibMkKernel_mk.h.
#define MkRefDecr | ( | ... | ) |
Definition at line 1695 of file kernel_overload_mk.h.
#define MkRefDecr_FX | ( | x | ) |
protect code-block, do not call the destructor…
Only call MkRefIncr_FX and MkRefDecr_FX together
Definition at line 4665 of file LibMkKernel_mk.h.
#define MkRefDecr_M | ( | m | ) |
decrement MkObjectS::refCount with runtime-cast of the instance-pointer.
[in] | m | Only use this if you dont trust the pointer. The pointer-cast will be MK_NULL if the pointer is invalid or broken. |
Definition at line 4660 of file LibMkKernel_mk.h.
#define MkRefDecr_M_NULL | ( | m | ) |
same as MkRefDecr_M but do not expect a runtime-cache.
Definition at line 4662 of file LibMkKernel_mk.h.
#define MkRefDecr_NULL | ( | ... | ) |
Definition at line 1694 of file kernel_overload_mk.h.
#define MkRefDecr_O | ( | o | ) |
decrement MkObjectS::refCount without cast of the object-pointer.
[in] | o | Prefer this if you trust the pointer and the pointer is a MkObjectC. |
Definition at line 4649 of file LibMkKernel_mk.h.
#define MkRefDecr_X | ( | x | ) |
decrement MkObjectS::refCount with compiletime-cast of the instance-pointer.
[in] | x | Prefer this if you trust the pointer and the pointer is not a MkObjectC. |
Definition at line 4653 of file LibMkKernel_mk.h.
#define MkRefDecr_X_NULL | ( | x | ) |
same as MkRefDecr_X but do not expect a runtime-cache.
Definition at line 4655 of file LibMkKernel_mk.h.
#define MkRefDecrWithoutSelf | ( | ... | ) |
Definition at line 1679 of file kernel_overload_mk.h.
#define MkRefDecrWithoutSelf_NULL | ( | ... | ) |
Definition at line 1678 of file kernel_overload_mk.h.
#define MkRefDecrWithUnlinkSelf | ( | ... | ) |
Definition at line 1677 of file kernel_overload_mk.h.
#define MkRefDecrWithUnlinkSelf_NULL | ( | ... | ) |
Definition at line 1676 of file kernel_overload_mk.h.
#define MkRefGet_1X | ( | x | ) |
Definition at line 4733 of file LibMkKernel_mk.h.
#define MkRefIncr_1M | ( | m | ) |
Definition at line 4615 of file LibMkKernel_mk.h.
#define MkRefIncr_1X | ( | x | ) |
Definition at line 4614 of file LibMkKernel_mk.h.
#define MkRefIncr_FX | ( | x | ) |
protect code-block, do not call the destructor…
Only call MkRefIncr_FX and MkRefDecr_FX together
Definition at line 4630 of file LibMkKernel_mk.h.
#define MkRefIncrSelf_2X | ( | x, | |
s ) |
Definition at line 4682 of file LibMkKernel_mk.h.
#define MkRefIsLocked_1X | ( | x | ) |
Definition at line 4752 of file LibMkKernel_mk.h.
#define MkRefLOCK 999999 |
unchangeable reference
Definition at line 4604 of file LibMkKernel_mk.h.
#define MkRefLock_1X | ( | x | ) |
Definition at line 4742 of file LibMkKernel_mk.h.
#define MkRefSet | ( | target, | |
source ) |
update target with source and keep the MkObjectS::refCount in sync
Definition at line 4755 of file LibMkKernel_mk.h.
#define MkSelfCreate | ( | ... | ) |
Definition at line 1683 of file kernel_overload_mk.h.
#define MkSelfCreate_2X | ( | x, | |
env ) |
Definition at line 4856 of file LibMkKernel_mk.h.
#define MkSelfCreate_NULL | ( | ... | ) |
Definition at line 1682 of file kernel_overload_mk.h.
#define MkSelfDelete | ( | ... | ) |
Definition at line 1697 of file kernel_overload_mk.h.
#define MkSelfDelete_1X | ( | x | ) |
Definition at line 4872 of file LibMkKernel_mk.h.
#define MkSelfDelete_NULL | ( | ... | ) |
Definition at line 1696 of file kernel_overload_mk.h.
#define MkSelfDeleteForce | ( | ... | ) |
Definition at line 1699 of file kernel_overload_mk.h.
#define MkSelfDeleteForce_1X | ( | x | ) |
Definition at line 4896 of file LibMkKernel_mk.h.
#define MkSelfDeleteForce_NULL | ( | ... | ) |
Definition at line 1698 of file kernel_overload_mk.h.
#define MkSelfExists_1X | ( | x | ) |
Definition at line 4930 of file LibMkKernel_mk.h.
#define MkSelfGet_1X | ( | x | ) |
Definition at line 4806 of file LibMkKernel_mk.h.
#define MkSelfNew | ( | ... | ) |
Definition at line 1687 of file kernel_overload_mk.h.
#define MkSelfNew_3X | ( | x, | |
self_out, | |||
env ) |
Definition at line 4839 of file LibMkKernel_mk.h.
#define MkSelfNew_C | ( | ... | ) |
Definition at line 1689 of file kernel_overload_mk.h.
#define MkSelfNew_E | ( | ... | ) |
Definition at line 1688 of file kernel_overload_mk.h.
#define MkSelfNew_NULL | ( | ... | ) |
Definition at line 1686 of file kernel_overload_mk.h.
#define MkSelfSet_3X | ( | x, | |
self, | |||
env ) |
Definition at line 4795 of file LibMkKernel_mk.h.
#define MkSelfUnlink | ( | ... | ) |
Definition at line 1701 of file kernel_overload_mk.h.
#define MkSelfUnlink_1X | ( | x | ) |
Definition at line 4921 of file LibMkKernel_mk.h.
#define MkSelfUnlink_NULL | ( | ... | ) |
Definition at line 1700 of file kernel_overload_mk.h.
Definition at line 4782 of file LibMkKernel_mk.h.
Definition at line 4781 of file LibMkKernel_mk.h.
call the copy from the object
MK_NULL
if no Merge-Constructor is availablefree the internal memory of an object and initialize the local variables to default values
return the reference-count-recursion-level
decrement the reference-count
MkObjectS::refCount <= 0
the destructor will be called. [in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
ATOMIC operation -> unlink self with reference-count.
First the MkObjectS::self and MkObjectS::env will be set to NULL and than MkRefDecr is called.
This api-function is used to free ccmkkernel ressources on an already destroyed Target-Programming-Language (TPL) instance.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
ATOMIC operation -> unlink self from META und decr-ref-count in META.
This ATOMIC operation has 2 steps:
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
get the reference-count
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
Definition at line 4728 of file LibMkKernel_mk.h.
|
inlinestatic |
increment the reference-count
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
Definition at line 4610 of file LibMkKernel_mk.h.
|
inlinestatic |
ATOMIC operation -> link self with reference-count.
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
[in] | self | this is the self pointer of the object in the programming-language-shell used for ccmkkernel pointer. |
[in] | env | storage for an application specific environment pointer. (java: JNIEnv*) |
Definition at line 4675 of file LibMkKernel_mk.h.
|
inlinestatic |
check if object is locked
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
Definition at line 4748 of file LibMkKernel_mk.h.
lock the object
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
Definition at line 4738 of file LibMkKernel_mk.h.
create the MkObjectS::self value
create the self from the object mng using MkTypeS::selfCreate
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
[in] | env | storage for an application specific environment pointer. (java: JNIEnv*) |
delete the MkObjectS::self value
delete the self from obj using MkTypeS::selfDelete
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
self
and mq-obj was deleted and false if self is not available or self-delete does not delete the mq-obj force delete an instance, last step in instance-destructor
A instance has two parts an PLMK (Programming-Language-Micro-Kernel)-part and a TPL-part, the PLMK (Programming-Language-Micro-Kernel)-part have to be deleted but the deletion of the TPL-part depend on the TPL object-model-philosophy. Some TPL have a HARD-delete some TPL have only a SOFT-delete, read more at MkObjectDelete.
This function will do the following steps:
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
true
if instance is global or was already deleted and false
if local
|
inlinestatic |
Check if the MkObjectS::self exists …
Definition at line 4925 of file LibMkKernel_mk.h.
get the MkObjectS::self value
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
Definition at line 4801 of file LibMkKernel_mk.h.
|
inlinestatic |
return the self pointer for a given obj …
This is an important function because every return of a managed-object in a Target-Programming-Language (TPL) will call this function to check if the self is already set. If true
the self is returned and if false
a new self is created.
the following steps are done:
refCount > 0
return the self pointerrefCount <= 0
return an error [in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
[out] | self_out | the new ccmkkernel object as return |
[in] | env | storage for an application specific environment pointer. This pointer will be passed to MkTypeS::selfCreate. (example java: JNIEnv*) |
libmkkernel::MK_OK
if self_out is new created libmkkernel::MK_CONTINUE
if self_out was from MkOBJ_R(ctx)
.self libmkkernel::MK_ERROR
on error Definition at line 13498 of file LibMkKernel_mk.h.
|
inlinestatic |
set the MkObjectS::self value
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
[in] | self | the target-language-self-pointer usually self or this |
[in] | env | storage for an application specific environment pointer. (java: JNIEnv*) |
Definition at line 4789 of file LibMkKernel_mk.h.
Run the MkTypeS::selfUnlink slot from the instance...
An instance has a META-part and a LNG-part, both are connected by MkObjectS::self and an LNG-specific proprietary connector. This low-level function will separate the MQpart from the LNG-part, leaving TWO independent objects.
The unlink has the following consequence:
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | obj | the MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API |
MK_NULL
.