theKernel 10.0
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_STRN const libmkkernel::MkObjectToName_RT (MK_RT mkrt, MK_OBJN const obj)
 Info-Slot - returns brief information about the obj as a string
 
MK_STRN libmkkernel::MkObjectToNameOfType_RT (MK_RT mkrt, MK_OBJN const obj)
 Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string
 
MK_STRN libmkkernel::MkObjectToNameOfClass_RT (MK_RT mkrt, MK_OBJ const obj)
 Class-Slot - returns the C++-Class-Name of the obj as string
 
MK_STRN libmkkernel::MkObjectToString_RT (MK_RT mkrt, MK_OBJN const inst)
 String-Slot - returns the string representation of the inst
 
static bool libmkkernel::MkObjectIsNull (MK_OBJ const obj)
 ckeck if the object is MK_NULL
 
MK_ERR libmkkernel::MkObjectErrorCatch_RT (MK_RT mkrt, MK_OBJN const obj, MK_EXP const exception, MK_STRN const callfunc)
 convert a programming-language-error into an ccmkkernel error …
 
static MK_ERR libmkkernel::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 - 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:
MkObjectErrorCatch_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 1644 of file kernel_overload_mk.h.

◆ MkObjectErrorCatch_1

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

Definition at line 1646 of file kernel_overload_mk.h.

◆ MkObjectErrorCatch_2

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

Definition at line 1645 of file kernel_overload_mk.h.

◆ MkObjectErrorCatch_NULL

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

Definition at line 1643 of file kernel_overload_mk.h.

◆ MkObjectInstancesOfType

#define MkObjectInstancesOfType ( ...)
Value:
MkObjectInstancesOfType_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1652 of file kernel_overload_mk.h.

◆ MkObjectInstancesOfType_NULL

#define MkObjectInstancesOfType_NULL ( ...)
Value:
MkObjectInstancesOfType_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1651 of file kernel_overload_mk.h.

◆ MkObjectToError

#define MkObjectToError ( ...)
Value:
MkObjectToError_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1648 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 13557 of file LibMkKernel_mk.h.

◆ MkObjectToError_NULL

#define MkObjectToError_NULL ( ...)
Value:
MkObjectToError_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1647 of file kernel_overload_mk.h.

◆ MkObjectToName

#define MkObjectToName ( ...)
Value:
MkObjectToName_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1656 of file kernel_overload_mk.h.

◆ MkObjectToName_1X

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

Definition at line 5233 of file LibMkKernel_mk.h.

◆ MkObjectToName_NULL

#define MkObjectToName_NULL ( ...)
Value:
MkObjectToName_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1655 of file kernel_overload_mk.h.

◆ MkObjectToNameOfClass

#define MkObjectToNameOfClass ( ...)
Value:
MkObjectToNameOfClass_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1658 of file kernel_overload_mk.h.

◆ MkObjectToNameOfClass_1X

#define MkObjectToNameOfClass_1X ( x)
Value:
MkObjectToNameOfClass_RT(MK_RT_CALL MkOBJ(x))

Definition at line 5273 of file LibMkKernel_mk.h.

◆ MkObjectToNameOfClass_NULL

#define MkObjectToNameOfClass_NULL ( ...)
Value:
MkObjectToNameOfClass_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1657 of file kernel_overload_mk.h.

◆ MkObjectToNameOfType

#define MkObjectToNameOfType ( ...)
Value:
MkObjectToNameOfType_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1660 of file kernel_overload_mk.h.

◆ MkObjectToNameOfType_1X

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

Definition at line 5255 of file LibMkKernel_mk.h.

◆ MkObjectToNameOfType_NULL

#define MkObjectToNameOfType_NULL ( ...)
Value:
MkObjectToNameOfType_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1659 of file kernel_overload_mk.h.

◆ MkObjectToString

#define MkObjectToString ( ...)
Value:
MkObjectToString_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 1662 of file kernel_overload_mk.h.

◆ MkObjectToString_1M

#define MkObjectToString_1M ( m)
Value:
MkObjectToString(m?MkObjN(m):NULL)
#define MkObjectToString(...)

Definition at line 5291 of file LibMkKernel_mk.h.

◆ MkObjectToString_1X

#define MkObjectToString_1X ( x)
Value:

Definition at line 5290 of file LibMkKernel_mk.h.

◆ MkObjectToString_NULL

#define MkObjectToString_NULL ( ...)
Value:
MkObjectToString_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 1661 of file kernel_overload_mk.h.

Function Documentation

◆ MkObjectErrorCatch_RT()

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

convert a programming-language-error into an ccmkkernel 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 ccmkkernel-error.

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

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

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

	    cl[id]->SendSTART();
	    try { 
	      ProxyItem(cl[id]);
	      cl[id]->SendEND_AND_WAIT("ECOI", 5);
	    } catch (const std::exception& e) {
	      auto err = ErrorCatch (e);
	      SendI32 (err->GetNum());
	      SendSTR (err->GetText());
	      err->Reset();
	    }
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, MK_NULL = resolve-own-name)
Returns
the ErrorDEFAULT initialized with exception value
See also
err.Raise() err.Reset(MK_STRN callfunc = __builtin_FUNCTION(), MK_I32 callline = __builtin_LINE(), MK_BOOL force = false)

◆ MkObjectIsNull()

static bool libmkkernel::MkObjectIsNull ( MK_OBJ const obj)
inlinestatic

ckeck if the object is MK_NULL

Definition at line 5295 of file LibMkKernel_mk.h.

5297 {
5298 return (obj == MK_NULL);
5299}
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C++ …
+ Here is the caller graph for this function:

◆ MkObjectToError_RT()

static MK_ERR libmkkernel::MkObjectToError_RT ( MK_RT mkrt,
MK_OBJ const obj )
inlinestatic

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 ccmkkernel 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 13549 of file LibMkKernel_mk.h.

13552 {
13554 return MkBinaryCreate(bin.size,(MK_BIN)MkSysMemDup(MK_ERROR_PANIC,bin.data,(size_t)bin.size));
13555}
#define MK_ERROR_PANIC
static MkBinaryR MkBinaryCreate(MK_SIZE size, MK_BINN data)
create a binary from data and size ...
MK_PTR MkSysMemDup(MK_OBJN fmtobj, MK_PTRN const blck, size_t const size)
memdup syscall with ccmkkernel error plugin
#define MK_STATIC_RT

◆ MkObjectToName_RT()

MK_STRN const libmkkernel::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 ccmkkernel 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_STRN libmkkernel::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 ccmkkernel runtime. Every class-object in C++ has an conterpart as ccmkkernel type-object in the Programming-Language-Micro-Kernel (PLMK).

ObjectToNameOfType returns the name of the ccmkkernel type
ObjectToNameOfClass returns the name of the C++ class

◆ MkObjectToNameOfType_RT()

MK_STRN libmkkernel::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 ccmkkernel runtime. Every class-object in C++ has an conterpart as ccmkkernel 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
+ Here is the caller graph for this function:

◆ MkObjectToString_RT()

MK_STRN libmkkernel::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 ccmkkernel function and therefore never becomes MK_NULL for a non-error result.
For details on the out/return value, see: MkKernel_Storage_C_API.
+ Here is the caller graph for this function: