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

MkObjectC - various functions related to the MkObjectSMore...

+ Collaboration diagram for MkObjectC_Misc_C_API:

Macros

#define MkObjectToName_1X(x)
 
#define MkObjectToNameOfType_1X(x)
 
#define MkObjectToNameOfClass_1X(x)
 
#define MkObjectToString_1X(x)
 
#define MkObjectToString_1M(m)
 
#define MkObjectToError_1X(obj)
 

Functions

MK_EXTERN MK_STRN const MkObjectToName_RT (MK_RT mkrt, MK_OBJN const obj)
 Info-Slot - returns brief information about the obj as a string
 
MK_EXTERN MK_STRN MkObjectToNameOfType_RT (MK_RT mkrt, MK_OBJN const obj)
 Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string
 
MK_EXTERN MK_STRN MkObjectToNameOfClass_RT (MK_RT mkrt, MK_OBJ const obj)
 Class-Slot - returns the C-Class-Name of the obj as string
 
MK_EXTERN MK_STRN MkObjectToString_RT (MK_RT mkrt, MK_OBJN const inst)
 String-Slot - returns the string representation of the inst
 
bool MkObjectIsNull (MK_OBJ const obj)
 ckeck if the object is MK_NULL
 
MK_EXTERN MK_ERR MkObjectErrorCatch_RT (MK_RT mkrt, MK_OBJN const obj, MK_EXP const exception, MK_STRN const callfunc)
 convert a programming-language-error into an libmkkernel error …
 
MK_ERR MkObjectToError_RT (MK_RT mkrt, MK_OBJ const obj)
 Error-Slot - return an error-object pre initialized with obj data.
 

MkObjectC - MkObjectC_Misc_C_API - function

MK_EXTERN MK_ERR MkObjectToErrorP (MK_RT mkrt, MK_OBJ const obj)
 Non-inline replacement for MkObjectToError
 
MK_EXTERN MK_I32 MkObjectHandleGetOfTypeP (MK_OBJ const obj)
 Non-inline replacement for MkObjectHandleGetOfType
 
MK_EXTERN MK_BOOL MkObjectIsNullP (MK_OBJ const obj)
 Non-inline replacement for MkObjectIsNull
 

MkObjectC - MkObjectC_Misc_C_API - overload

#define MkObjectErrorCatch_NULL(...)
 
#define MkObjectErrorCatch(...)
 
#define MkObjectErrorCatch_2(obj, exception)
 
#define MkObjectErrorCatch_1(obj)
 
#define MkObjectToError_NULL(...)
 
#define MkObjectToError(...)
 
#define MkObjectInstancesOfType_NULL(...)
 
#define MkObjectInstancesOfType(...)
 
#define MkObjectToName_NULL(...)
 
#define MkObjectToName(...)
 
#define MkObjectToNameOfClass_NULL(...)
 
#define MkObjectToNameOfClass(...)
 
#define MkObjectToNameOfType_NULL(...)
 
#define MkObjectToNameOfType(...)
 
#define MkObjectToString_NULL(...)
 
#define MkObjectToString(...)
 

Detailed Description

MkObjectC - various functions related to the MkObjectS

Macro Definition Documentation

◆ MkObjectErrorCatch

#define MkObjectErrorCatch ( ...)
Value:
MK_EXTERN MK_ERR MkObjectErrorCatch_RT(MK_RT mkrt, MK_OBJN const obj, MK_EXP const exception, MK_STRN const callfunc)
convert a programming-language-error into an libmkkernel error …
#define MK_RT_CALL

Definition at line 1579 of file kernel_overload_mk.h.

◆ MkObjectErrorCatch_1

#define MkObjectErrorCatch_1 ( obj)
Value:
MkObjectErrorCatch(obj,NULL,__func__)
#define MkObjectErrorCatch(...)

Definition at line 1581 of file kernel_overload_mk.h.

◆ MkObjectErrorCatch_2

#define MkObjectErrorCatch_2 ( obj,
exception )
Value:
MkObjectErrorCatch(obj,exception,__func__)

Definition at line 1580 of file kernel_overload_mk.h.

◆ MkObjectErrorCatch_NULL

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

Definition at line 1578 of file kernel_overload_mk.h.

◆ MkObjectInstancesOfType

#define MkObjectInstancesOfType ( ...)
Value:
MK_OBJ MkObjectInstancesOfType_RT(MK_RT mkrt, MK_SIG typeSIG)
return the head-instance from a specific type defined by signature typeSIG …

Definition at line 1587 of file kernel_overload_mk.h.

◆ MkObjectInstancesOfType_NULL

#define MkObjectInstancesOfType_NULL ( ...)
Value:

Definition at line 1586 of file kernel_overload_mk.h.

◆ MkObjectToError

#define MkObjectToError ( ...)
Value:
MK_ERR MkObjectToError_RT(MK_RT mkrt, MK_OBJ const obj)
Error-Slot - return an error-object pre initialized with obj data.

Definition at line 1583 of file kernel_overload_mk.h.

◆ MkObjectToError_1X

#define MkObjectToError_1X ( obj)
Value:
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer
#define MkObjectToError(...)

Definition at line 12682 of file LibMkKernel_mk.h.

◆ MkObjectToError_NULL

#define MkObjectToError_NULL ( ...)
Value:

Definition at line 1582 of file kernel_overload_mk.h.

◆ MkObjectToName

#define MkObjectToName ( ...)
Value:
MK_EXTERN MK_STRN const MkObjectToName_RT(MK_RT mkrt, MK_OBJN const obj)
Info-Slot - returns brief information about the obj as a string

Definition at line 1591 of file kernel_overload_mk.h.

◆ MkObjectToName_1X

#define MkObjectToName_1X ( x)
Value:
#define MkObjectToName(...)

Definition at line 4772 of file LibMkKernel_mk.h.

◆ MkObjectToName_NULL

#define MkObjectToName_NULL ( ...)
Value:

Definition at line 1590 of file kernel_overload_mk.h.

◆ MkObjectToNameOfClass

#define MkObjectToNameOfClass ( ...)
Value:
MK_EXTERN MK_STRN MkObjectToNameOfClass_RT(MK_RT mkrt, MK_OBJ const obj)
Class-Slot - returns the C-Class-Name of the obj as string

Definition at line 1593 of file kernel_overload_mk.h.

◆ MkObjectToNameOfClass_1X

#define MkObjectToNameOfClass_1X ( x)
Value:

Definition at line 4812 of file LibMkKernel_mk.h.

◆ MkObjectToNameOfClass_NULL

#define MkObjectToNameOfClass_NULL ( ...)
Value:

Definition at line 1592 of file kernel_overload_mk.h.

◆ MkObjectToNameOfType

#define MkObjectToNameOfType ( ...)
Value:
MK_EXTERN MK_STRN MkObjectToNameOfType_RT(MK_RT mkrt, MK_OBJN const obj)
Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string

Definition at line 1595 of file kernel_overload_mk.h.

◆ MkObjectToNameOfType_1X

#define MkObjectToNameOfType_1X ( x)
Value:
#define MkObjectToNameOfType(...)

Definition at line 4794 of file LibMkKernel_mk.h.

◆ MkObjectToNameOfType_NULL

#define MkObjectToNameOfType_NULL ( ...)
Value:

Definition at line 1594 of file kernel_overload_mk.h.

◆ MkObjectToString

#define MkObjectToString ( ...)
Value:
MK_EXTERN MK_STRN MkObjectToString_RT(MK_RT mkrt, MK_OBJN const inst)
String-Slot - returns the string representation of the inst …

Definition at line 1597 of file kernel_overload_mk.h.

◆ MkObjectToString_1M

#define MkObjectToString_1M ( m)
Value:
MK_OBJN MkObjN(MK_MNGN mng)
(const) cast a unknown-object into an MkObjectS pointer or NULL if not possible
#define MkObjectToString(...)

Definition at line 4830 of file LibMkKernel_mk.h.

◆ MkObjectToString_1X

#define MkObjectToString_1X ( x)
Value:

Definition at line 4829 of file LibMkKernel_mk.h.

◆ MkObjectToString_NULL

#define MkObjectToString_NULL ( ...)
Value:

Definition at line 1596 of file kernel_overload_mk.h.

Function Documentation

◆ MkObjectErrorCatch_RT()

MK_EXTERN MK_ERR MkObjectErrorCatch_RT ( MK_RT mkrt,
MK_OBJN const obj,
MK_EXP const exception,
MK_STRN const callfunc )

convert a programming-language-error into an libmkkernel error …

This function is a placeholder and have to be overloaded by the Target-Programming-Language (TPL). The goal is to handel an error-catch condition and convert an programming-language-error into an libmkkernel-error.

This is the same as (example form c++):

mngx->ErrorFORMAT()->Catch(exception)

Example from server.c catch-send and reset an error

      MQ_CTX const clmqctx = srvctx->cl[clid];
      MqSendSTART_E (clmqctx);
      MqProxyItem_E (mqctx, clmqctx);
      if (MkErrorCheckI(MqSendEND_AND_WAIT(clmqctx, "ECOI", 5))) {
        MqContextErrorCopy (mqctx, clmqctx);
	MqSendI32_E (mqctx, MkErrorGetNum_0E());
	MqSendSTR_E (mqctx, MkErrorGetText_0E());
	MkErrorReset_1X(mqctx);
      }
Note
The C language does not support the MkErrorCatch because there is no native error object.
If there is no error at all the MkErrorCatch does nothing and just return the MkErrorDEFAULT.
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
[in]exceptionthe exception object from C, if MK_NULL the global exception object is used
[in]callfunca user-defined postfix to identify the calling function or the environment (default=name-of-function)
Returns
the ErrorDEFAULT initialized with exception value
See also
(runtime) enum MkErrorE MkErrorRaise(MK_ERRN const err) (runtime) enum MkErrorE MkErrorReset(MK_ERR const err, MK_STRN const callfunc, MK_I32 const callline, MK_BOOL const force)

◆ MkObjectHandleGetOfTypeP()

MK_EXTERN MK_I32 MkObjectHandleGetOfTypeP ( MK_OBJ const obj)

Non-inline replacement for MkObjectHandleGetOfType

◆ MkObjectIsNull()

bool MkObjectIsNull ( MK_OBJ const obj)
inline

ckeck if the object is MK_NULL

Definition at line 4835 of file LibMkKernel_mk.h.

4835 {
4836 return (obj == MK_NULL);
4837}
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkObjectIsNullP()

MK_EXTERN MK_BOOL MkObjectIsNullP ( MK_OBJ const obj)

Non-inline replacement for MkObjectIsNull

◆ MkObjectToError_RT()

MK_ERR MkObjectToError_RT ( MK_RT mkrt,
MK_OBJ const obj )
inline

Error-Slot - return an error-object pre initialized with obj data.

This slot is the same as ErrorDEFAULT with fmtobj set to this

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 error-object
Attention
(do not free) The memory of the out/return value belongs to the called LibMkKernel function and therefore never becomes MK_NULL for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.

Definition at line 12674 of file LibMkKernel_mk.h.

12677 {
12678 MK_INSTANCE_RT_O(obj);
12679 return MkErrorFORMAT_1O(obj);
12680}
#define MkErrorFORMAT_1O(o)
#define MK_INSTANCE_RT_O(o)

◆ MkObjectToErrorP()

MK_EXTERN MK_ERR MkObjectToErrorP ( MK_RT mkrt,
MK_OBJ const obj )

Non-inline replacement for MkObjectToError

◆ MkObjectToName_RT()

MK_EXTERN MK_STRN const MkObjectToName_RT ( MK_RT mkrt,
MK_OBJN const obj )

Info-Slot - returns brief information about the obj as a string

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 identification of the object as string
Attention
(do not free) The memory of the out/return value belongs to the called LibMkKernel function and therefore never becomes MK_NULL for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.

◆ MkObjectToNameOfClass_RT()

MK_EXTERN MK_STRN MkObjectToNameOfClass_RT ( MK_RT mkrt,
MK_OBJ const obj )

Class-Slot - returns the C-Class-Name of the obj as string

The Programming-Language-Micro-Kernel (PLMK) connect the C language with the libmkkernel runtime. Every class-object in C has an conterpart as libmkkernel type-object in the Programming-Language-Micro-Kernel (PLMK).

ObjectToNameOfType returns the name of the libmkkernel type
ObjectToNameOfClass returns the name of the C class

◆ MkObjectToNameOfType_RT()

MK_EXTERN MK_STRN MkObjectToNameOfType_RT ( MK_RT mkrt,
MK_OBJN const obj )

Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string

The Programming-Language-Micro-Kernel (PLMK) connect the C language with the libmkkernel runtime. Every class-object in C has an conterpart as libmkkernel type-object in the Programming-Language-Micro-Kernel (PLMK).

ObjectToNameOfType returns the name of the libmsgque type
ObjectToNameOfClass returns the name of the C class
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 name of the object-type as a string

◆ MkObjectToString_RT()

MK_EXTERN MK_STRN MkObjectToString_RT ( MK_RT mkrt,
MK_OBJN const inst )

String-Slot - returns the string representation of the inst

The string is a human-readable form of the data stored in the object.

See also
slot: every class should provide a ToString function by default.
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]inst- the instance to work on
Returns
the requested string or "MK_NULL" on error
Note
(do not free) The memory of the out/return value belongs to the called LibMkKernel function and therefore never becomes MK_NULL for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.