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

MkBufferStreamC - define the class … More...

+ Collaboration diagram for MkBufferStreamC_Class_C_API:

Topics

 MkBufferStreamC_Class_Define_C_API
 MkBufferStreamC - low level definition, access and cast …
 

Typedefs

typedef struct MkBufferStreamSMK_BUS
 class-shortcut for struct MkBufferStreamS *, all shortcut using the XX_YYY syntax (only for public API) …
 
typedef const struct MkBufferStreamSMK_BUSN
 class-shortcut for const struct MkBufferStreamS *, all const shortcut using the XX_YYYC syntax (only for public API) …
 
typedef struct MkBufferStreamS MK_BUSR
 reference-shortcut for struct MkBufferStreamS, all shortcut using the XX_YYYR syntax (only for public API) …
 

MkBufferStreamC - Export - inline - interact with an external software

static MK_HDL MkBufferStreamHandleGet_RT (MK_RT mkrt, MK_BUS const bus)
 Handle-Get-Slot - returns a export-hdl to the MkBufferStreamC useable for external storage
 
static MK_BUS MkBufferStreamHandleResolve_RT (MK_RT mkrt, MK_HDL const netHdl)
 Handle-Resolve-Slot - return a MkBufferStreamC from netHdl or MK_NULL if invalid…
 
#define MkBufferStreamHandleResolve_e(netHdl)
 wrapper for MkBufferStreamHandleResolve with error-handline
 

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

static MK_BUS MkBufferStreamGetNull (void)
 Null-Slot - return a MkBufferStreamC typed NULL instance …
 

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

static MK_BUS MkBufferStreamInstances_RT (MK_RT mkrt)
 get head-instance from linked-list of MkBufferStreamS type …
 
static MK_BUS MkBufferStreamNext (MK_BUS const bus)
 get next instance from linked-list of MkBufferStreamS type
 
static MK_BUS MkBufferStreamPrev (MK_BUS const bus)
 get previous instance from linked-list of MkBufferStreamS type
 

MkBufferStreamC - Export - function

MK_BUS MkBufferStreamHandleResolveP (MK_RT mkrt, MK_HDL const netHdl)
 Non-inline replacement for MkBufferStreamHandleResolve
 
MK_HDL MkBufferStreamHandleGetP (MK_RT mkrt, MK_BUS const bus)
 Non-inline replacement for MkBufferStreamHandleGet
 

MkBufferStreamC - Introspection - function

MK_BUS MkBufferStreamNextP (MK_BUS const bus)
 Non-inline replacement for MkBufferStreamNext
 
MK_BUS MkBufferStreamPrevP (MK_BUS const bus)
 Non-inline replacement for MkBufferStreamPrev
 
MK_BUS MkBufferStreamInstancesP (MK_RT mkrt)
 Non-inline replacement for MkBufferStreamInstances
 

MkBufferStreamC - Misc - function

MK_BUS MkBufferStreamGetNullP (void)
 Non-inline replacement for MkBufferStreamGetNull
 

MkBufferStreamC - Export - overload

#define MkBufferStreamHandleResolve_NULL(...)
 
#define MkBufferStreamHandleResolve(...)
 
#define MkBufferStreamHandleGet_NULL(...)
 
#define MkBufferStreamHandleGet(...)
 

MkBufferStreamC - Introspection - overload

#define MkBufferStreamInstances_NULL()
 
#define MkBufferStreamInstances()
 

Detailed Description

MkBufferStreamC - define the class …

Macro Definition Documentation

◆ MkBufferStreamHandleGet

#define MkBufferStreamHandleGet ( ...)
Value:
static MK_HDL MkBufferStreamHandleGet_RT(MK_RT mkrt, MK_BUS const bus)
Handle-Get-Slot - returns a export-hdl to the MkBufferStreamC useable for external storage
#define MK_RT_CALL

Definition at line 667 of file kernel_overload_mk.h.

◆ MkBufferStreamHandleGet_NULL

#define MkBufferStreamHandleGet_NULL ( ...)
Value:

Definition at line 666 of file kernel_overload_mk.h.

◆ MkBufferStreamHandleResolve

#define MkBufferStreamHandleResolve ( ...)
Value:
static MK_BUS MkBufferStreamHandleResolve_RT(MK_RT mkrt, MK_HDL const netHdl)
Handle-Resolve-Slot - return a MkBufferStreamC from netHdl or MK_NULL if invalid…

Definition at line 663 of file kernel_overload_mk.h.

◆ MkBufferStreamHandleResolve_e

#define MkBufferStreamHandleResolve_e ( netHdl)
Value:
({ \
MK_HDL tmpHdl=netHdl; \
MK_BUS tmp; \
if (tmpHdl==0) { \
tmp=NULL; \
} else { \
if (tmp==NULL) { \
MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
goto error; \
}; \
}; \
tmp; \
})
#define MkBufferStreamHandleResolve(...)
int32_t MK_HDL
4 byte int handle data-type
The ABSTRACT-CLASS MkBufferStreamS is used for package-based serialized IO …

wrapper for MkBufferStreamHandleResolve with error-handline

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

Definition at line 7565 of file LibMkKernel_mk.h.

7565#define MkBufferStreamHandleResolve_e(netHdl) ({ \
7566 MK_HDL tmpHdl=netHdl; \
7567 MK_BUS tmp; \
7568 if (tmpHdl==0) { \
7569 tmp=NULL; \
7570 } else { \
7571 tmp=MkBufferStreamHandleResolve(tmpHdl); \
7572 if (tmp==NULL) { \
7573 MkErrorSetC_1_NULL("ERROR: 'MkBufferStreamC' handle is 'NULL'"); \
7574 goto error; \
7575 }; \
7576 }; \
7577 tmp; \
7578})

◆ MkBufferStreamHandleResolve_NULL

#define MkBufferStreamHandleResolve_NULL ( ...)
Value:

Definition at line 662 of file kernel_overload_mk.h.

◆ MkBufferStreamInstances

#define MkBufferStreamInstances ( )
Value:
static MK_BUS MkBufferStreamInstances_RT(MK_RT mkrt)
get head-instance from linked-list of MkBufferStreamS type …
#define MK_RT_CALL_ONLY

Definition at line 678 of file kernel_overload_mk.h.

◆ MkBufferStreamInstances_NULL

#define MkBufferStreamInstances_NULL ( )
Value:

Definition at line 677 of file kernel_overload_mk.h.

Typedef Documentation

◆ MK_BUS

typedef struct MkBufferStreamS* MK_BUS

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

Definition at line 1452 of file LibMkKernel_mk.h.

◆ MK_BUSN

typedef const struct MkBufferStreamS* MK_BUSN

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

Definition at line 1455 of file LibMkKernel_mk.h.

◆ MK_BUSR

typedef struct MkBufferStreamS MK_BUSR

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

Definition at line 1458 of file LibMkKernel_mk.h.

Function Documentation

◆ MkBufferStreamGetNull()

static MK_BUS MkBufferStreamGetNull ( void )
inlinestatic

Null-Slot - return a MkBufferStreamC typed NULL instance …

Definition at line 7590 of file LibMkKernel_mk.h.

7590 {
7591 return (MK_BUS)MK_NULL;
7592 }
#define MK_NULL
The Programming-Language-Micro-Kernel (PLMK) NULL value as MK_NULL in C …

◆ MkBufferStreamGetNullP()

MK_BUS MkBufferStreamGetNullP ( void )

Non-inline replacement for MkBufferStreamGetNull

◆ MkBufferStreamHandleGet_RT()

static MK_HDL MkBufferStreamHandleGet_RT ( MK_RT mkrt,
MK_BUS const bus )
inlinestatic

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

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

Definition at line 7532 of file LibMkKernel_mk.h.

7535 {
7536 return MkObjectHandleGet(bus?MkOBJ(bus):NULL);
7537}
#define MkObjectHandleGet(...)
#define MkOBJ(x)
cast a known-object into an MkObjectS pointer

◆ MkBufferStreamHandleGetP()

MK_HDL MkBufferStreamHandleGetP ( MK_RT mkrt,
MK_BUS const bus )

Non-inline replacement for MkBufferStreamHandleGet

◆ MkBufferStreamHandleResolve_RT()

static MK_BUS MkBufferStreamHandleResolve_RT ( MK_RT mkrt,
MK_HDL const netHdl )
inlinestatic

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

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

Definition at line 7549 of file LibMkKernel_mk.h.

7552 {
7553 return MkBus(MkObjectHandleResolve(netHdl));
7554}
static MK_BUS MkBus(MK_MNG mng)
cast a unknown-object into an MkBufferStreamS pointer or NULL if not possible
#define MkObjectHandleResolve(...)

◆ MkBufferStreamHandleResolveP()

MK_BUS MkBufferStreamHandleResolveP ( MK_RT mkrt,
MK_HDL const netHdl )

Non-inline replacement for MkBufferStreamHandleResolve

◆ MkBufferStreamInstances_RT()

static MK_BUS MkBufferStreamInstances_RT ( MK_RT mkrt)
inlinestatic

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

The head-instance is the last instance created.

Definition at line 12722 of file LibMkKernel_mk.h.

12722 {
12724 return (MK_BUS)MkBufferStreamC_TT->instances;
12725}
#define MkBufferStreamC_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
#define MK_STATIC_RT

◆ MkBufferStreamInstancesP()

MK_BUS MkBufferStreamInstancesP ( MK_RT mkrt)

Non-inline replacement for MkBufferStreamInstances

◆ MkBufferStreamNext()

static MK_BUS MkBufferStreamNext ( MK_BUS const bus)
inlinestatic

get next instance from linked-list of MkBufferStreamS type

Definition at line 12729 of file LibMkKernel_mk.h.

12729 {
12730 MK_INSTANCE_HDL(bus);
12731 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.next;
12732}
#define MkBufferStreamC_X2obj(x)
#define MK_INSTANCE_HDL(x)

◆ MkBufferStreamNextP()

MK_BUS MkBufferStreamNextP ( MK_BUS const bus)

Non-inline replacement for MkBufferStreamNext

◆ MkBufferStreamPrev()

static MK_BUS MkBufferStreamPrev ( MK_BUS const bus)
inlinestatic

get previous instance from linked-list of MkBufferStreamS type

Definition at line 12736 of file LibMkKernel_mk.h.

12736 {
12737 MK_INSTANCE_HDL(bus);
12738 return (MK_BUS)MkBufferStreamC_X2obj(bus)->obj_protect.prev;
12739}

◆ MkBufferStreamPrevP()

MK_BUS MkBufferStreamPrevP ( MK_BUS const bus)

Non-inline replacement for MkBufferStreamPrev