MkObjectC - managed-object details More...
Functions | |
MK_OBJ | MkObjCopy_RT (MK_RT mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng) |
call the copy from the object | |
MK_OBJ | 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(* | MkSelfIncrF) (MK_RT mkrt, MK_PTR self, MK_PTR const env) |
typedef void(* | MkSelfDecrF) (MK_RT mkrt, MK_PTR self, MK_PTR const env) |
static void | MkSelfSet (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
set the MkObjectS::self value | |
static MK_PTR | MkSelfGet (MK_OBJ const obj) |
get the MkObjectS::self value | |
static MK_ATTR_HOT enum MkErrorE | 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 | MkSelfCreate_RT (MK_RT mkrt, MK_OBJ const obj, MK_PTR const env) |
create the MkObjectS::self value | |
bool | MkSelfDelete_RT (MK_RT mkrt, MK_OBJ const obj) |
delete the MkObjectS::self value | |
bool | MkSelfDeleteForce_RT (MK_RT mkrt, MK_OBJ obj) |
force delete an instance, last step in instance-destructor | |
void | MkSelfUnlink_RT (MK_RT mkrt, MK_OBJ obj) |
Run the MkTypeS::selfUnlink slot from the instance... | |
static bool | 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 | MkRefIncr (MK_OBJ obj) |
increment the reference-count | |
void | MkRefDecr_RT (MK_RT mkrt, MK_OBJ obj) |
decrement the reference-count | |
static void | MkRefIncrSelf (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
ATOMIC operation -> link self with reference-count. | |
MK_OBJ | MkRefDecrWithoutSelf_RT (MK_RT mkrt, MK_OBJ const obj) |
ATOMIC operation -> unlink self with reference-count. | |
MK_OBJ | MkRefDecrWithUnlinkSelf_RT (MK_RT mkrt, MK_OBJ const obj) |
ATOMIC operation -> unlink self from META und decr-ref-count in MQ. | |
static MK_I32 | MkRefGet (MK_OBJ const obj) |
get the reference-count | |
static MK_I32 | MkRefLock (MK_OBJ const obj) |
lock the object | |
static bool | MkRefIsLocked (MK_OBJ const obj) |
check if object is locked | |
MK_NUM | 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 - function | |
MK_I32 | MkRefGetP (MK_OBJ const obj) |
Non-inline replacement for MkRefGet … | |
void | MkRefIncrSelfP (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
Non-inline replacement for MkRefIncrSelf … | |
MK_BOOL | MkRefIsLockedP (MK_OBJ const obj) |
Non-inline replacement for MkRefIsLocked … | |
MK_I32 | MkRefLockP (MK_OBJ const obj) |
Non-inline replacement for MkRefLock … | |
MK_BOOL | MkSelfExistsP (MK_OBJN obj) |
Non-inline replacement for MkSelfExists … | |
MK_PTR | MkSelfGetP (MK_OBJ const obj) |
Non-inline replacement for MkSelfGet … | |
void | MkSelfSetP (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
Non-inline replacement for MkSelfSet … | |
enum MkErrorE | MkSelfNewP (MK_RT mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env) |
Non-inline replacement for MkSelfNew … | |
void | MkRefIncrP (MK_OBJ obj) |
Non-inline replacement for MkRefIncr … | |
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 1639 of file kernel_overload_mk.h.
#define MkObjCopy_NULL | ( | ... | ) |
Definition at line 1638 of file kernel_overload_mk.h.
#define MkObjReset | ( | ... | ) |
Definition at line 1641 of file kernel_overload_mk.h.
#define MkObjReset_NULL | ( | ... | ) |
Definition at line 1640 of file kernel_overload_mk.h.
#define MkRefCidN | ( | ) |
Definition at line 1659 of file kernel_overload_mk.h.
#define MkRefCidN_NULL | ( | ) |
Definition at line 1658 of file kernel_overload_mk.h.
#define MkRefCidN_NULL | ( | ) |
Definition at line 4560 of file LibMkKernel_mk.h.
#define MkRefDecr | ( | ... | ) |
Definition at line 1661 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 4457 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 4452 of file LibMkKernel_mk.h.
#define MkRefDecr_M_NULL | ( | m | ) |
same as MkRefDecr_M but do not expect a runtime-cache.
Definition at line 4454 of file LibMkKernel_mk.h.
#define MkRefDecr_NULL | ( | ... | ) |
Definition at line 1660 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 4441 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 4445 of file LibMkKernel_mk.h.
#define MkRefDecr_X_NULL | ( | x | ) |
same as MkRefDecr_X but do not expect a runtime-cache.
Definition at line 4447 of file LibMkKernel_mk.h.
#define MkRefDecrWithoutSelf | ( | ... | ) |
Definition at line 1645 of file kernel_overload_mk.h.
#define MkRefDecrWithoutSelf_NULL | ( | ... | ) |
Definition at line 1644 of file kernel_overload_mk.h.
#define MkRefDecrWithUnlinkSelf | ( | ... | ) |
Definition at line 1643 of file kernel_overload_mk.h.
#define MkRefDecrWithUnlinkSelf_NULL | ( | ... | ) |
Definition at line 1642 of file kernel_overload_mk.h.
#define MkRefGet_1X | ( | x | ) |
Definition at line 4525 of file LibMkKernel_mk.h.
#define MkRefIncr_1M | ( | m | ) |
Definition at line 4407 of file LibMkKernel_mk.h.
#define MkRefIncr_1X | ( | x | ) |
Definition at line 4406 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 4422 of file LibMkKernel_mk.h.
#define MkRefIncrSelf_2X | ( | x, | |
s ) |
Definition at line 4474 of file LibMkKernel_mk.h.
#define MkRefIsLocked_1X | ( | x | ) |
Definition at line 4544 of file LibMkKernel_mk.h.
#define MkRefLOCK 999999 |
unchangeable reference
Definition at line 4396 of file LibMkKernel_mk.h.
#define MkRefLock_1X | ( | x | ) |
Definition at line 4534 of file LibMkKernel_mk.h.
#define MkRefSet | ( | target, | |
source ) |
update target with source and keep the MkObjectS::refCount in sync
Definition at line 4547 of file LibMkKernel_mk.h.
#define MkSelfCreate | ( | ... | ) |
Definition at line 1649 of file kernel_overload_mk.h.
#define MkSelfCreate_2X | ( | x, | |
env ) |
Definition at line 4648 of file LibMkKernel_mk.h.
#define MkSelfCreate_NULL | ( | ... | ) |
Definition at line 1648 of file kernel_overload_mk.h.
#define MkSelfDelete | ( | ... | ) |
Definition at line 1663 of file kernel_overload_mk.h.
#define MkSelfDelete_1X | ( | x | ) |
Definition at line 4664 of file LibMkKernel_mk.h.
#define MkSelfDelete_NULL | ( | ... | ) |
Definition at line 1662 of file kernel_overload_mk.h.
#define MkSelfDeleteForce | ( | ... | ) |
Definition at line 1665 of file kernel_overload_mk.h.
#define MkSelfDeleteForce_1X | ( | x | ) |
Definition at line 4688 of file LibMkKernel_mk.h.
#define MkSelfDeleteForce_NULL | ( | ... | ) |
Definition at line 1664 of file kernel_overload_mk.h.
#define MkSelfExists_1X | ( | x | ) |
Definition at line 4721 of file LibMkKernel_mk.h.
#define MkSelfGet_1X | ( | x | ) |
Definition at line 4598 of file LibMkKernel_mk.h.
#define MkSelfNew | ( | ... | ) |
Definition at line 1653 of file kernel_overload_mk.h.
#define MkSelfNew_3X | ( | x, | |
self_out, | |||
env ) |
Definition at line 4631 of file LibMkKernel_mk.h.
#define MkSelfNew_C | ( | ... | ) |
Definition at line 1655 of file kernel_overload_mk.h.
#define MkSelfNew_E | ( | ... | ) |
Definition at line 1654 of file kernel_overload_mk.h.
#define MkSelfNew_NULL | ( | ... | ) |
Definition at line 1652 of file kernel_overload_mk.h.
#define MkSelfSet_3X | ( | x, | |
self, | |||
env ) |
Definition at line 4587 of file LibMkKernel_mk.h.
#define MkSelfUnlink | ( | ... | ) |
Definition at line 1667 of file kernel_overload_mk.h.
#define MkSelfUnlink_1X | ( | x | ) |
Definition at line 4712 of file LibMkKernel_mk.h.
#define MkSelfUnlink_NULL | ( | ... | ) |
Definition at line 1666 of file kernel_overload_mk.h.
Definition at line 4574 of file LibMkKernel_mk.h.
Definition at line 4573 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
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 libmkkernel 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 MQ.
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 4520 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 4402 of file LibMkKernel_mk.h.
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 libmkkernel pointer. |
[in] | env | storage for an application specific environment pointer. (java: JNIEnv*) |
Definition at line 4467 of file LibMkKernel_mk.h.
Non-inline replacement for MkRefIncrSelf …
|
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 4540 of file LibMkKernel_mk.h.
Non-inline replacement for MkRefIsLocked …
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 4530 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 |
MK_YES
if instance is global or was already deleted and MK_NO
if local
|
inlinestatic |
Check if the MkObjectS::self exists …
Definition at line 4716 of file LibMkKernel_mk.h.
Non-inline replacement for MkSelfExists …
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 4593 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 MK_YES
the self is returned and if MK_NO
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 libmkkernel object as return |
[in] | env | storage for an application specific environment pointer. This pointer will be passed to MkTypeS::selfCreate. (example java: JNIEnv*) |
MK_OK
if self_out is new created MK_CONTINUE
if self_out was from MkOBJ_R(ctx)
.self MK_ERROR
on error Definition at line 12946 of file LibMkKernel_mk.h.
Non-inline replacement for MkSelfNew …
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 4581 of file LibMkKernel_mk.h.
Non-inline replacement for MkSelfSet …
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 |