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

MkBufferC - define the class … More...

+ Collaboration diagram for MkBufferC_Class_C_API:

Topics

 MkBufferC_Class_Define_C_API
 MkBufferC - low level definition, access and cast …
 

Typedefs

typedef struct MkBufferSlibmkkernel::MK_BUF
 class-shortcut for struct MkBufferS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkBufferSlibmkkernel::MK_BUFN
 class-shortcut for const struct MkBufferS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkBufferS libmkkernel::MK_BUFR
 reference-shortcut for struct MkBufferS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MkBufferC - Export - inline - interact with an external software

MK_HDL libmkkernel::MkBufferHandleGet_RT (MK_RT const mkrt, MK_BUF const buf)
 Handle-Get-Slot - returns a export-hdl to the MkBufferC useable for external storage
 
MK_RT_ATTR_HDL MK_BUF libmkkernel::MkBufferHandleResolve_RT (MK_RT const mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a MkBufferC from netHdl or MK_NULL if invalid…
 
#define MkBufferHandleResolve_e(netHdl)
 wrapper for MkBufferHandleResolve with error-handline
 

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

MK_BUF libmkkernel::MkBufferGetNull (void)
 Null-Slot - return a MkBufferC typed NULL instance …
 

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

MK_BUF libmkkernel::MkBufferInstances_RT (MK_RT_PARSER_ONLY)
 get head-instance from linked-list of MkBufferS type …
 
MK_ATTR_HDL MK_BUF libmkkernel::MkBufferNext (MK_BUF const buf)
 get next instance from linked-list of MkBufferS type
 
MK_ATTR_HDL MK_BUF libmkkernel::MkBufferPrev (MK_BUF const buf)
 get previous instance from linked-list of MkBufferS type
 

MkBufferC - Export - overload

#define MkBufferHandleResolve_NULL(...)
 
#define MkBufferHandleResolve(...)
 
#define MkBufferHandleGet_NULL(...)
 
#define MkBufferHandleGet(...)
 

MkBufferC - Introspection - overload

#define MkBufferInstances_NULL()
 
#define MkBufferInstances()
 

Detailed Description

MkBufferC - define the class …

Macro Definition Documentation

◆ MkBufferHandleGet

#define MkBufferHandleGet ( ...)
Value:
MkBufferHandleGet_RT(MK_RT_CALL __VA_ARGS__)
#define MK_RT_CALL

Definition at line 58 of file kernel_overload_mk.h.

◆ MkBufferHandleGet_NULL

#define MkBufferHandleGet_NULL ( ...)
Value:
MkBufferHandleGet_RT(MK_RT_CALL_NULL __VA_ARGS__)
#define MK_RT_CALL_NULL

Definition at line 57 of file kernel_overload_mk.h.

◆ MkBufferHandleResolve

#define MkBufferHandleResolve ( ...)
Value:
MkBufferHandleResolve_RT(MK_RT_CALL __VA_ARGS__)

Definition at line 54 of file kernel_overload_mk.h.

◆ MkBufferHandleResolve_e

#define MkBufferHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
MK_BUF tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
tmp=MkBufferHandleResolve(tmpHdl); \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
#define MkBufferHandleResolve(...)

wrapper for MkBufferHandleResolve with error-handline

Parameters
[in]netHdlThe handle previously returned by MkObjectHandleGet.
Returns
Return an valid libmkkernel::MK_BUF 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.
  • MkBufferHandleResolve return an valid libmkkernel::MK_BUF 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 libmkkernel::MK_BUF is returned than the netHdl is valid.

Definition at line 5424 of file LibMkKernel_mk.h.

5424#define MkBufferHandleResolve_e(netHdl) ({ \
5425 MK_HDL tmpHdl=netHdl; \
5426 MK_BUF tmp; \
5427 if (tmpHdl==0) { \
5428 tmp=NULL; \
5429 } else { \
5430 tmp=MkBufferHandleResolve(tmpHdl); \
5431 if (tmp==NULL) { \
5432 MkErrorSetC_1_NULL("ERROR: 'MkBufferC' handle is 'NULL'"); \
5433 goto error; \
5434 }; \
5435 }; \
5436 tmp; \
5437})

◆ MkBufferHandleResolve_NULL

#define MkBufferHandleResolve_NULL ( ...)
Value:
MkBufferHandleResolve_RT(MK_RT_CALL_NULL __VA_ARGS__)

Definition at line 53 of file kernel_overload_mk.h.

◆ MkBufferInstances

#define MkBufferInstances ( )
Value:
MkBufferInstances_RT(MK_RT_CALL_ONLY)
#define MK_RT_CALL_ONLY

Definition at line 69 of file kernel_overload_mk.h.

◆ MkBufferInstances_NULL

#define MkBufferInstances_NULL ( )
Value:
MkBufferInstances_RT(MK_RT_CALL_NULL_ONLY)
#define MK_RT_CALL_NULL_ONLY

Definition at line 68 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_BUF

typedef struct MkBufferS* libmkkernel::MK_BUF

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

Definition at line 1554 of file LibMkKernel_mk.h.

◆ MK_BUFN

typedef const struct MkBufferS* libmkkernel::MK_BUFN

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

Definition at line 1557 of file LibMkKernel_mk.h.

◆ MK_BUFR

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

Definition at line 1560 of file LibMkKernel_mk.h.

Function Documentation

◆ MkBufferGetNull()

MK_BUF libmkkernel::MkBufferGetNull ( void )
inline

Null-Slot - return a MkBufferC typed NULL instance …

Definition at line 5448 of file LibMkKernel_mk.h.

5448 {
5449 return (MK_BUF)MK_NULL;
5450 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C++ …
+ Here is the caller graph for this function:

◆ MkBufferHandleGet_RT()

MK_HDL libmkkernel::MkBufferHandleGet_RT ( MK_RT const mkrt,
MK_BUF const buf )
inline

Handle-Get-Slot - returns a export-hdl to the MkBufferC 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 MkBufferHandleResolve.

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]bufthe MkBufferS instance to work on
Returns
the required export-hdl

Definition at line 5391 of file LibMkKernel_mk.h.

5394 {
5396 return MkObjectHandleGet(MkOBJ(buf));
#define MkObjectHandleGet(...)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer
#define MK_RT_ATTR_HDL_CHECK(x)
#define MK_RT_ATTR_RUNTIME
#define MK_RT_ATTR_HDL

◆ MkBufferHandleResolve_RT()

MK_RT_ATTR_HDL MK_BUF libmkkernel::MkBufferHandleResolve_RT ( MK_RT const mkrt,
MK_HDL const netHdl )
inline

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

The MkBufferHandleResolve undo the MkBufferHandleGet 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 MkBufferHandleGet
Returns
the required handle or MK_NULL if netHdl is invalid

Definition at line 5408 of file LibMkKernel_mk.h.

5411 {
5412 return MkBuf(MkObjectHandleResolve(netHdl));
MK_BUF MkBuf(MK_MNG mng)
cast a unknown-object into an MkBufferS pointer or NULL if not possible
#define MkObjectHandleResolve(...)

◆ MkBufferInstances_RT()

MK_BUF libmkkernel::MkBufferInstances_RT ( MK_RT_PARSER_ONLY )
inline

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

The head-instance is the last instance created.

Definition at line 12254 of file LibMkKernel_mk.h.

12254 {
12256 return (MK_BUF)MkBufferC_TT->instances;
12257}
#define MkBufferC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MkRtSetup_NULL_RT
+ Here is the caller graph for this function:

◆ MkBufferNext()

MK_ATTR_HDL MK_BUF libmkkernel::MkBufferNext ( MK_BUF const buf)
inline

get next instance from linked-list of MkBufferS type

Definition at line 12261 of file LibMkKernel_mk.h.

12261 {
12262 MK_ATTR_HDL_CHECK(buf);
12263 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.next;
12264}
#define MK_ATTR_HDL_CHECK(x)
#define MkBufferC_X2obj(x)
+ Here is the caller graph for this function:

◆ MkBufferPrev()

MK_ATTR_HDL MK_BUF libmkkernel::MkBufferPrev ( MK_BUF const buf)
inline

get previous instance from linked-list of MkBufferS type

Definition at line 12268 of file LibMkKernel_mk.h.

12268 {
12269 MK_ATTR_HDL_CHECK(buf);
12270 return (MK_BUF)MkBufferC_X2obj(buf)->obj_protect.prev;
12271}
+ Here is the caller graph for this function: