MkObjectC - managed-object details More...
Functions | |
MK_EXTERN MK_OBJ | MkObjCopy_RT (MK_RT const mkrt, MK_OBJ const tgtmng, MK_OBJN const srcmng) MK_RT_ATTR_HDL |
call the copy from the object | |
MK_EXTERN void | MkObjReset_RT (MK_RT const mkrt, MK_OBJ const obj) MK_RT_ATTR_HDL |
free the internal memory of an object and initialize the local variables to default values | |
MkSelf | |
typedef void(* | MkSelfIncrF) (MK_RT const mkrt, MK_PTR self, MK_PTR const env) |
typedef void(* | MkSelfDecrF) (MK_RT const mkrt, MK_PTR self, MK_PTR const env) |
MK_ATTR_HDL | |
void | MkSelfSet (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
set the MkObjectS::self value | |
MK_PTR | MkSelfGet (MK_OBJ const obj) |
get the MkObjectS::self value | |
mk_attr_hot enum MkErrorE | MkSelfNew_RT (MK_RT const mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env) |
return the self pointer for a given obj … | |
MK_EXTERN MK_PTR | MkSelfCreate_RT (MK_RT const mkrt, MK_OBJ const obj, MK_PTR const env) MK_RT_ATTR_HDL |
create the MkObjectS::self value | |
MK_EXTERN bool | MkSelfDelete_RT (MK_RT const mkrt, MK_OBJ const obj) MK_RT_ATTR_HDL |
delete the MkObjectS::self value | |
MK_EXTERN bool | MkSelfDeleteForce_RT (MK_RT const mkrt, MK_OBJ obj) MK_RT_ATTR_HDL |
force delete an instance, last step in instance-destructor | |
MK_EXTERN void | MkSelfUnlink_RT (MK_RT const mkrt, MK_OBJ obj) MK_RT_ATTR_HDL |
Run the MkTypeS::selfUnlink slot from the instance... | |
#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) |
MkRef… | |
reference management functions | |
void | MkRefIncr (MK_OBJ obj) |
increment the reference-count | |
MK_EXTERN void | MkRefDecr_RT (MK_RT const mkrt, MK_OBJ obj) MK_RT_ATTR_HDL |
decrement the reference-count | |
MK_ATTR_HDL void | MkRefIncrSelf (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
ATOMIC operation -> link self with reference-count. | |
MK_EXTERN MK_OBJ | MkRefDecrWithoutSelf_RT (MK_RT const mkrt, MK_OBJ const obj) MK_RT_ATTR_HDL |
ATOMIC operation -> unlink self with reference-count. | |
MK_ATTR_HDL MK_I32 | MkRefGet (MK_OBJ const obj) |
get the reference-count | |
MK_ATTR_HDL MK_I32 | MkRefLock (MK_OBJ const obj) |
lock the object | |
MK_ATTR_HDL bool | MkRefIsLocked (MK_OBJ const obj) |
check if object is locked | |
MK_EXTERN MK_NUM | MkRefCidN_RT (MK_RT_PARSER_ONLY) |
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_EXTERN MK_I32 | MkRefGetP (MK_OBJ const obj) |
Non-inline replacement for MkRefGet … | |
MK_EXTERN void | MkRefIncrSelfP (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
Non-inline replacement for MkRefIncrSelf … | |
MK_EXTERN MK_BOOL | MkRefIsLockedP (MK_OBJ const obj) |
Non-inline replacement for MkRefIsLocked … | |
MK_EXTERN MK_I32 | MkRefLockP (MK_OBJ const obj) |
Non-inline replacement for MkRefLock … | |
MK_EXTERN MK_PTR | MkSelfGetP (MK_OBJ const obj) |
Non-inline replacement for MkSelfGet … | |
MK_EXTERN void | MkSelfSetP (MK_OBJ const obj, MK_PTR const self, MK_PTR const env) |
Non-inline replacement for MkSelfSet … | |
MK_EXTERN enum MkErrorE | MkSelfNewP (MK_RT const mkrt, MK_OBJ obj, MK_PTR *self_out, MK_PTR const env) |
Non-inline replacement for MkSelfNew … | |
MK_EXTERN 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 | MkRefDecrWithoutSelf_NULL(...) |
#define | MkRefDecrWithoutSelf(...) |
#define | MkObjReset_NULL(...) |
#define | MkObjReset(...) |
#define | MkSelfNew_NULL(...) |
#define | MkSelfNew(...) |
#define | MkSelfNew_E(...) |
#define | MkSelfNew_C(...) |
#define | MkRefCidN_NULL() |
#define | MkRefCidN() |
#define | MkRefDecr_NULL(...) |
#define | MkRefDecr(...) |
#define | MkSelfCreate_NULL(...) |
#define | MkSelfCreate(...) |
#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 1578 of file kernel_overload_mk.h.
#define MkObjCopy_NULL | ( | ... | ) |
Definition at line 1577 of file kernel_overload_mk.h.
#define MkObjReset | ( | ... | ) |
Definition at line 1584 of file kernel_overload_mk.h.
#define MkObjReset_NULL | ( | ... | ) |
Definition at line 1583 of file kernel_overload_mk.h.
#define MkRefCidN | ( | ) |
Definition at line 1594 of file kernel_overload_mk.h.
#define MkRefCidN_NULL | ( | ) |
Definition at line 1593 of file kernel_overload_mk.h.
#define MkRefCidN_NULL | ( | ) |
Definition at line 4320 of file LibMkKernel_mk.h.
#define MkRefDecr | ( | ... | ) |
Definition at line 1596 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 4236 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 4231 of file LibMkKernel_mk.h.
#define MkRefDecr_M_NULL | ( | m | ) |
same as MkRefDecr_M but do not expect a runtime-cache.
Definition at line 4233 of file LibMkKernel_mk.h.
#define MkRefDecr_NULL | ( | ... | ) |
Definition at line 1595 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 4220 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 4224 of file LibMkKernel_mk.h.
#define MkRefDecr_X_NULL | ( | x | ) |
same as MkRefDecr_X but do not expect a runtime-cache.
Definition at line 4226 of file LibMkKernel_mk.h.
#define MkRefDecrWithoutSelf | ( | ... | ) |
Definition at line 1580 of file kernel_overload_mk.h.
#define MkRefDecrWithoutSelf_NULL | ( | ... | ) |
Definition at line 1579 of file kernel_overload_mk.h.
#define MkRefGet_1X | ( | x | ) |
Definition at line 4285 of file LibMkKernel_mk.h.
#define MkRefIncr_1M | ( | m | ) |
Definition at line 4186 of file LibMkKernel_mk.h.
#define MkRefIncr_1X | ( | x | ) |
Definition at line 4185 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 4201 of file LibMkKernel_mk.h.
#define MkRefIncrSelf_2X | ( | x, | |
s ) |
Definition at line 4253 of file LibMkKernel_mk.h.
#define MkRefIsLocked_1X | ( | x | ) |
Definition at line 4304 of file LibMkKernel_mk.h.
#define MkRefLOCK 999999 |
unchangeable reference
Definition at line 4176 of file LibMkKernel_mk.h.
#define MkRefLock_1X | ( | x | ) |
Definition at line 4294 of file LibMkKernel_mk.h.
#define MkRefSet | ( | target, | |
source ) |
update target with source and keep the MkObjectS::refCount in sync
Definition at line 4307 of file LibMkKernel_mk.h.
#define MkSelfCreate | ( | ... | ) |
Definition at line 1598 of file kernel_overload_mk.h.
#define MkSelfCreate_2X | ( | x, | |
env ) |
Definition at line 4406 of file LibMkKernel_mk.h.
#define MkSelfCreate_NULL | ( | ... | ) |
Definition at line 1597 of file kernel_overload_mk.h.
#define MkSelfDelete | ( | ... | ) |
Definition at line 1600 of file kernel_overload_mk.h.
#define MkSelfDelete_1X | ( | x | ) |
Definition at line 4422 of file LibMkKernel_mk.h.
#define MkSelfDelete_NULL | ( | ... | ) |
Definition at line 1599 of file kernel_overload_mk.h.
#define MkSelfDeleteForce | ( | ... | ) |
Definition at line 1602 of file kernel_overload_mk.h.
#define MkSelfDeleteForce_1X | ( | x | ) |
Definition at line 4446 of file LibMkKernel_mk.h.
#define MkSelfDeleteForce_NULL | ( | ... | ) |
Definition at line 1601 of file kernel_overload_mk.h.
#define MkSelfGet_1X | ( | x | ) |
Definition at line 4356 of file LibMkKernel_mk.h.
#define MkSelfNew | ( | ... | ) |
Definition at line 1588 of file kernel_overload_mk.h.
#define MkSelfNew_3X | ( | x, | |
self_out, | |||
env ) |
Definition at line 4389 of file LibMkKernel_mk.h.
#define MkSelfNew_C | ( | ... | ) |
Definition at line 1590 of file kernel_overload_mk.h.
#define MkSelfNew_E | ( | ... | ) |
Definition at line 1589 of file kernel_overload_mk.h.
#define MkSelfNew_NULL | ( | ... | ) |
Definition at line 1587 of file kernel_overload_mk.h.
#define MkSelfSet_3X | ( | x, | |
self, | |||
env ) |
Definition at line 4346 of file LibMkKernel_mk.h.
#define MkSelfUnlink | ( | ... | ) |
Definition at line 1604 of file kernel_overload_mk.h.
#define MkSelfUnlink_1X | ( | x | ) |
Definition at line 4470 of file LibMkKernel_mk.h.
#define MkSelfUnlink_NULL | ( | ... | ) |
Definition at line 1603 of file kernel_overload_mk.h.
Definition at line 4334 of file LibMkKernel_mk.h.
Definition at line 4333 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
MK_EXTERN MK_NUM MkRefCidN_RT | ( | MK_RT_PARSER_ONLY | ) |
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 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 |
|
inline |
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 4280 of file LibMkKernel_mk.h.
|
inline |
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 4181 of file LibMkKernel_mk.h.
|
inline |
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 4246 of file LibMkKernel_mk.h.
Non-inline replacement for MkRefIncrSelf …
|
inline |
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 4300 of file LibMkKernel_mk.h.
Non-inline replacement for MkRefIsLocked …
|
inline |
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 4290 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 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 4351 of file LibMkKernel_mk.h.
|
inline |
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 12511 of file LibMkKernel_mk.h.
MK_EXTERN enum MkErrorE MkSelfNewP | ( | MK_RT const | mkrt, |
MK_OBJ | obj, | ||
MK_PTR * | self_out, | ||
MK_PTR const | env ) |
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 4340 of file LibMkKernel_mk.h.
Non-inline replacement for MkSelfSet …
Run the MkTypeS::selfUnlink slot from the instance...
An instance has an MQ-part and an 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_ATTR_HDL |
Definition at line 4344 of file LibMkKernel_mk.h.