theKernel 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
MkObjectC_Class_C_API

MkObjectC - define the class … More...

+ Collaboration diagram for MkObjectC_Class_C_API:

Topics

 MkObjectC_Class_Introspection_C_API
 MkObjectC - get information from the MkTypeS
 
 MkObjectC_Class_Define_C_API
 MkObjectC - low level definition, access and cast …
 

Typedefs

typedef struct MkObjectSMK_OBJ
 class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkObjectSMK_OBJN
 class-shortcut for const struct MkObjectS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkObjectS MK_OBJR
 reference-shortcut for struct MkObjectS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MkObjectC - Export - inline - interact with an external software

static MK_HDL MkObjectHandleGetOfType (MK_OBJ const obj)
 Export-Slot - returns typeHdl of the obj .
 
bool MkObjectHandleExists (MK_OBJ const obj)
 check if obj has already a handle defined…
 
MK_HDL MkObjectHandleGetOr0 (MK_OBJ const obj)
 return export-hdl or 0 in not created…
 
MK_HDL MkObjectHandleGet_RT (MK_RT mkrt, MK_OBJ const obj)
 Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage
 
MK_OBJ MkObjectHandleResolve_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a MkObjectC from netHdl or MK_NULL if invalid…
 
void MkObjectHandleDeleteByNetHdl_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Delete-Slot - delete a netHdl from handle-storage …
 
void MkObjectHandleDelete_RT (MK_RT mkrt, MK_OBJ const netObj)
 Handle-Delete-Slot - delete a netObj from handle-storage …
 
#define MkObjectHandleGetOfType_1X(x)
 
#define MkObjectHandleGet_1X(x)
 
#define MkObjectHandleResolve_e(netHdl)
 wrapper for MkObjectHandleResolve with error-handline
 

MkObjectC - Misc - function - unspecified functions to perform different tasks

static MK_OBJ MkObjectGetNull (void)
 Null-Slot - return a MkObjectC typed NULL instance …
 

MkObjectC - Introspection - inline - access to all instances created by class starting with the last one

static MK_OBJ MkObjectInstances_RT (MK_RT mkrt)
 get head-instance from linked-list of MkObjectS type …
 
static MK_OBJ MkObjectNext (MK_OBJ const obj)
 get next instance from linked-list of MkObjectS type
 
static MK_OBJ MkObjectPrev (MK_OBJ const obj)
 get previous instance from linked-list of MkObjectS type
 

MkObjectC - Export - function

MK_HDL MkObjectHandleGetOfTypeP (MK_OBJ const obj)
 Non-inline replacement for MkObjectHandleGetOfType
 

MkObjectC - Introspection - function

MK_OBJ MkObjectNextP (MK_OBJ const obj)
 Non-inline replacement for MkObjectNext
 
MK_OBJ MkObjectPrevP (MK_OBJ const obj)
 Non-inline replacement for MkObjectPrev
 
MK_OBJ MkObjectInstancesP (MK_RT mkrt)
 Non-inline replacement for MkObjectInstances
 

MkObjectC - Misc - function

MK_OBJ MkObjectGetNullP (void)
 Non-inline replacement for MkObjectGetNull
 

MkObjectC - Export - overload

#define MkObjectHandleResolve_NULL(...)
 
#define MkObjectHandleResolve(...)
 
#define MkObjectHandleDelete_NULL(...)
 
#define MkObjectHandleDelete(...)
 
#define MkObjectHandleGet_NULL(...)
 
#define MkObjectHandleGet(...)
 
#define MkObjectHandleDeleteByNetHdl_NULL(...)
 
#define MkObjectHandleDeleteByNetHdl(...)
 

MkObjectC - Introspection - overload

#define MkObjectInstances_NULL()
 
#define MkObjectInstances()
 

Detailed Description

MkObjectC - define the class …

Macro Definition Documentation

◆ MkObjectHandleDelete

#define MkObjectHandleDelete ( ...)
Value:
void MkObjectHandleDelete_RT(MK_RT mkrt, MK_OBJ const netObj)
Handle-Delete-Slot - delete a netObj from handle-storage …
#define MK_RT_CALL

Definition at line 1496 of file kernel_overload_mk.h.

◆ MkObjectHandleDelete_NULL

#define MkObjectHandleDelete_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 1495 of file kernel_overload_mk.h.

◆ MkObjectHandleDeleteByNetHdl

#define MkObjectHandleDeleteByNetHdl ( ...)
Value:
void MkObjectHandleDeleteByNetHdl_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Delete-Slot - delete a netHdl from handle-storage …

Definition at line 1502 of file kernel_overload_mk.h.

◆ MkObjectHandleDeleteByNetHdl_NULL

#define MkObjectHandleDeleteByNetHdl_NULL ( ...)
Value:

Definition at line 1501 of file kernel_overload_mk.h.

◆ MkObjectHandleGet

#define MkObjectHandleGet ( ...)
Value:
MK_HDL MkObjectHandleGet_RT(MK_RT mkrt, MK_OBJ const obj)
Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage

Definition at line 1498 of file kernel_overload_mk.h.

◆ MkObjectHandleGet_1X

#define MkObjectHandleGet_1X ( x)
Value:
#define MkObjectHandleGet(...)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer

Definition at line 3481 of file LibMkKernel_mk.h.

◆ MkObjectHandleGet_NULL

#define MkObjectHandleGet_NULL ( ...)
Value:

Definition at line 1497 of file kernel_overload_mk.h.

◆ MkObjectHandleGetOfType_1X

#define MkObjectHandleGetOfType_1X ( x)
Value:
static MK_HDL MkObjectHandleGetOfType(MK_OBJ const obj)
Export-Slot - returns typeHdl of the obj .

Definition at line 3424 of file LibMkKernel_mk.h.

◆ MkObjectHandleResolve

#define MkObjectHandleResolve ( ...)
Value:
MK_OBJ MkObjectHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkObjectC from netHdl or MK_NULL if invalid…

Definition at line 1492 of file kernel_overload_mk.h.

◆ MkObjectHandleResolve_e

#define MkObjectHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
MK_OBJ tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
tmp=MkObjectHandleResolve(tmpHdl); \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
int32_t MK_HDL
4 byte int handle data-type
#define MkObjectHandleResolve(...)
object header …

wrapper for MkObjectHandleResolve with error-handline

Parameters
[in]netHdlThe handle previously returned by MkObjectHandleGet.
Returns
Return an valid MK_OBJ or MK_NULL with an error set.
  • If netHdl is 0 than MK_NULL is returned and the upper-code decide how to deal with it.
  • MkObjectHandleResolve return an valid MK_OBJ or MK_NULL if the netHdl is invalid or the underlying object has already been deleted.
    • If a MK_NULL is returned than an error-message is created and a jump to the label error is done.
    • If a MK_OBJ is returned than the netHdl is valid.

Definition at line 3505 of file LibMkKernel_mk.h.

3505#define MkObjectHandleResolve_e(netHdl) ({ \
3506 MK_HDL tmpHdl=netHdl; \
3507 MK_OBJ tmp; \
3508 if (tmpHdl==0) { \
3509 tmp=NULL; \
3510 } else { \
3511 tmp=MkObjectHandleResolve(tmpHdl); \
3512 if (tmp==NULL) { \
3513 MkErrorSetC_1_NULL("ERROR: 'MkObjectC' handle is 'NULL'"); \
3514 goto error; \
3515 }; \
3516 }; \
3517 tmp; \
3518})

◆ MkObjectHandleResolve_NULL

#define MkObjectHandleResolve_NULL ( ...)
Value:

Definition at line 1491 of file kernel_overload_mk.h.

◆ MkObjectInstances

#define MkObjectInstances ( )
Value:
static MK_OBJ MkObjectInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkObjectS type …
#define MK_RT_CALL_ONLY

Definition at line 1513 of file kernel_overload_mk.h.

◆ MkObjectInstances_NULL

#define MkObjectInstances_NULL ( )
Value:

Definition at line 1512 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_OBJ

typedef struct MkObjectS* MK_OBJ

class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …

Definition at line 1424 of file LibMkKernel_mk.h.

◆ MK_OBJN

typedef const struct MkObjectS* MK_OBJN

class-shortcut for const struct MkObjectS *, all const shortcut using the XX_YYYC syntax (only for public API) …

Definition at line 1427 of file LibMkKernel_mk.h.

◆ MK_OBJR

typedef struct MkObjectS MK_OBJR

reference-shortcut for struct MkObjectS, all shortcut using the XX_YYYR syntax (only for public API) …

Definition at line 1430 of file LibMkKernel_mk.h.

Function Documentation

◆ MkObjectGetNull()

static MK_OBJ MkObjectGetNull ( void )
inlinestatic

Null-Slot - return a MkObjectC typed NULL instance …

Definition at line 3544 of file LibMkKernel_mk.h.

3544 {
3545 return (MK_OBJ)MK_NULL;
3546 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkObjectGetNullP()

MK_OBJ MkObjectGetNullP ( void )

Non-inline replacement for MkObjectGetNull

◆ MkObjectHandleDelete_RT()

void MkObjectHandleDelete_RT ( MK_RT mkrt,
MK_OBJ const netObj )

Handle-Delete-Slot - delete a netObj from handle-storage …

◆ MkObjectHandleDeleteByNetHdl_RT()

void MkObjectHandleDeleteByNetHdl_RT ( MK_RT mkrt,
MK_HDL const netHdl )

Handle-Delete-Slot - delete a netHdl from handle-storage …

◆ MkObjectHandleExists()

bool MkObjectHandleExists ( MK_OBJ const obj)

check if obj has already a handle defined…

Parameters
[in]objthe MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API
Returns
MK_YES or MK_NO

◆ MkObjectHandleGet_RT()

MK_HDL MkObjectHandleGet_RT ( MK_RT mkrt,
MK_OBJ const obj )

Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage

The export-hdl is a reference to an instance that can be stored in software and converted back into an instance using the MkObjectHandleResolve.

By default, the export-hdl is initialized to "0", which is equivalent to does not exist. This function returns a non-zero and unique export-hdl that is recreated if necessary.

The export-hdl is only valid until the Programming-Language-Micro-Kernel (PLMK) ends.

example: The export-hdl is used in rpc to identify an object across the network.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]objthe MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API
Returns
the required export-hdl

◆ MkObjectHandleGetOfType()

static MK_HDL MkObjectHandleGetOfType ( MK_OBJ const obj)
inlinestatic

Export-Slot - returns typeHdl of the obj .

A typeHdl identifies the type the obj belongs to. All instances of the same type share the same typeHdl.

Parameters
[in]objthe MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API
Returns
the required typeHdl

Definition at line 3420 of file LibMkKernel_mk.h.

3420 {
3421 return ((MK_HDL)obj->signature);
3422}

◆ MkObjectHandleGetOfTypeP()

MK_HDL MkObjectHandleGetOfTypeP ( MK_OBJ const obj)

Non-inline replacement for MkObjectHandleGetOfType

◆ MkObjectHandleGetOr0()

MK_HDL MkObjectHandleGetOr0 ( MK_OBJ const obj)

return export-hdl or 0 in not created…

Same as MkObjectHandleGet, but no new export-hdl is created if it has not already been created and the initial value 0 is returned instead.

Parameters
[in]objthe MkObjectS instance to work on - a MANAGED OBJECT after type-check and able to be supported by the MkObjectS API
Returns
the required export-hdl

◆ MkObjectHandleResolve_RT()

MK_OBJ MkObjectHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )

Handle-Resolve-Slot - return a MkObjectC from netHdl or MK_NULL if invalid…

The MkObjectHandleResolve undo the MkObjectHandleGet and is intended to export a unique identifer into external code not belonging to the Programming-Language-Micro-Kernel (PLMK).

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]netHdlhandle former exported with MkObjectHandleGet
Returns
the required handle or MK_NULL if netHdl is invalid

◆ MkObjectInstances_RT()

static MK_OBJ MkObjectInstances_RT ( MK_RT mkrt)
inlinestatic

get head-instance from linked-list of MkObjectS type …

The head-instance is the last instance created.

Definition at line 12827 of file LibMkKernel_mk.h.

12827 {
12829 return (MK_OBJ)MkObjectC_TT->instances;
12830}
#define MkObjectC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MK_STATIC_RT

◆ MkObjectInstancesP()

MK_OBJ MkObjectInstancesP ( MK_RT mkrt)

Non-inline replacement for MkObjectInstances

◆ MkObjectNext()

static MK_OBJ MkObjectNext ( MK_OBJ const obj)
inlinestatic

get next instance from linked-list of MkObjectS type

Definition at line 12834 of file LibMkKernel_mk.h.

12834 {
12835 MK_INSTANCE_HDL(obj);
12836 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.next;
12837}
#define MkObjectC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkObjectNextP()

MK_OBJ MkObjectNextP ( MK_OBJ const obj)

Non-inline replacement for MkObjectNext

◆ MkObjectPrev()

static MK_OBJ MkObjectPrev ( MK_OBJ const obj)
inlinestatic

get previous instance from linked-list of MkObjectS type

Definition at line 12841 of file LibMkKernel_mk.h.

12841 {
12842 MK_INSTANCE_HDL(obj);
12843 return (MK_OBJ)MkObjectC_X2obj(obj)->obj_protect.prev;
12844}

◆ MkObjectPrevP()

MK_OBJ MkObjectPrevP ( MK_OBJ const obj)

Non-inline replacement for MkObjectPrev