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

MkBufferC - various functions to create, initialize and destroy a MkBufferCMore...

+ Collaboration diagram for MkBufferC_TOR_C_API:

Macros

#define MkBufferCreateTLS_T(cls, name, size)
 create an new MkBufferC object as T)hread L)ocal S)torage…
 
#define MkBufferCreateTLS_inout_T(cls, name, inout)
 Constructs a MkBufferC instance as T)hread L)ocal S)torage OR reuse inout if possible…
 
#define MkBufferCreateLOCAL_T(cls, name, size)
 create an new MkBufferC object as L)ocal S)torage…
 

Functions

MK_EXTERN MK_BUF MkBufferCreate_RT (MK_RT mkrt, MK_TYP type, MK_NUM const size)
 Constructor - create a new MkBufferC with minimum size of internal storage …
 
MK_EXTERN MK_BUF MkBufferCreate64_RT (MK_RT mkrt, MK_NUM const size)
 call the BufferCreate with default type MkBuffer64S (64 byte) …
 
MK_EXTERN MK_BUF MkBufferCreate256_RT (MK_RT mkrt, MK_NUM const size)
 call the BufferCreate with default type MkBuffer256S (256 byte) …
 
MK_EXTERN MK_BUF MkBufferCreate1024_RT (MK_RT mkrt, MK_NUM const size)
 call the BufferCreate with default type MkBuffer1024S (1024 byte) …
 
void MkBufferCreateTLS_T (MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_NUM const size)
 
void MkBufferCreateTLS_inout_T (MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_BUF *inout)
 
void MkBufferCreateLOCAL_T (MK_MACRO_TYP cls, MK_MACRO_TYP name, MK_NUM const size)
 
MK_EXTERN MK_BUF MkBufferCreateI8_RT (MK_RT mkrt, MK_I8 const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateBOL_RT (MK_RT mkrt, MK_BOL const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateI16_RT (MK_RT mkrt, MK_I16 const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateI32_RT (MK_RT mkrt, MK_I32 const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateFLT_RT (MK_RT mkrt, MK_FLT const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateI64_RT (MK_RT mkrt, MK_I64 const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateDBL_RT (MK_RT mkrt, MK_DBL const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateSTR_RT (MK_RT mkrt, MK_STRN const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateBIN_RT (MK_RT mkrt, MkBinaryR const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN MK_BUF MkBufferCreateTLS_RT (MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
 same as BufferCreate but require no cleanup
 
MK_EXTERN MK_BUF MkBufferCreateBUF_RT (MK_RT mkrt, MK_BUFN const val)
 Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
MK_EXTERN void MkBufferFree_RT (MK_RT mkrt, MK_BUF const buf)
 initialize or free an MkBufferC reference-instance
 
MK_EXTERN void MkBufferInit_RT (MK_RT mkrt, MK_BUF const buf, MK_TYP type, MK_NUM const size)
 initialize or free an MkBufferC reference-instance
 
MK_EXTERN void MkBufferDelete_RT (MK_RT mkrt, MK_BUF const buf)
 Destructor - delete a MkBufferC instance …
 
MK_EXTERN MK_BUF MkBufferDup_RT (MK_RT mkrt, MK_BUFN const buf)
 Dup-Constructor - create a new MkBufferC instance as copy from an existing MkBufferC instance
 
MK_EXTERN MK_BUF MkBufferMerge_RT (MK_RT mkrt, MK_BUF const buf)
 Merge-Constructor - create a new MkBufferC as a merge from an existing object …
 

MkBufferC - MkBufferC_TOR_C_API - overload

#define MkBufferMerge_NULL(...)
 
#define MkBufferMerge(...)
 
#define MkBufferDup_NULL(...)
 
#define MkBufferDup(...)
 
#define MkBufferCreate_NULL(...)
 
#define MkBufferCreate(...)
 
#define MkBufferCreate_1(size)
 
#define MkBufferCreate_0()
 
#define MkBufferCreate1024_NULL(...)
 
#define MkBufferCreate1024(...)
 
#define MkBufferCreate1024_0()
 
#define MkBufferCreate256_NULL(...)
 
#define MkBufferCreate256(...)
 
#define MkBufferCreate256_0()
 
#define MkBufferCreate64_NULL(...)
 
#define MkBufferCreate64(...)
 
#define MkBufferCreate64_0()
 
#define MkBufferCreateBIN_NULL(...)
 
#define MkBufferCreateBIN(...)
 
#define MkBufferCreateBOL_NULL(...)
 
#define MkBufferCreateBOL(...)
 
#define MkBufferCreateBUF_NULL(...)
 
#define MkBufferCreateBUF(...)
 
#define MkBufferCreateDBL_NULL(...)
 
#define MkBufferCreateDBL(...)
 
#define MkBufferCreateFLT_NULL(...)
 
#define MkBufferCreateFLT(...)
 
#define MkBufferCreateI16_NULL(...)
 
#define MkBufferCreateI16(...)
 
#define MkBufferCreateI32_NULL(...)
 
#define MkBufferCreateI32(...)
 
#define MkBufferCreateI64_NULL(...)
 
#define MkBufferCreateI64(...)
 
#define MkBufferCreateI8_NULL(...)
 
#define MkBufferCreateI8(...)
 
#define MkBufferCreateSTR_NULL(...)
 
#define MkBufferCreateSTR(...)
 
#define MkBufferDelete(x)
 
#define MkBufferCreateTLS_NULL(...)
 
#define MkBufferCreateTLS(...)
 
#define MkBufferCreateTLS_1(tlsName)
 
#define MkBufferFree_NULL(...)
 
#define MkBufferFree(...)
 
#define MkBufferInit_NULL(...)
 
#define MkBufferInit(...)
 
#define MkBufferInit_2(buf, size)
 
#define MkBufferInit_1(buf)
 

Detailed Description

MkBufferC - various functions to create, initialize and destroy a MkBufferC

Macro Definition Documentation

◆ MkBufferCreate

#define MkBufferCreate ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreate_RT(MK_RT mkrt, MK_TYP type, MK_NUM const size)
Constructor - create a new MkBufferC with minimum size of internal storage …
#define MK_RT_CALL

Definition at line 282 of file kernel_overload_mk.h.

◆ MkBufferCreate1024

#define MkBufferCreate1024 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreate1024_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer1024S (1024 byte) …

Definition at line 286 of file kernel_overload_mk.h.

◆ MkBufferCreate1024_0

#define MkBufferCreate1024_0 ( )
Value:
#define MkBufferCreate1024(...)

Definition at line 287 of file kernel_overload_mk.h.

◆ MkBufferCreate1024_NULL

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

Definition at line 285 of file kernel_overload_mk.h.

◆ MkBufferCreate256

#define MkBufferCreate256 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreate256_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer256S (256 byte) …

Definition at line 289 of file kernel_overload_mk.h.

◆ MkBufferCreate256_0

#define MkBufferCreate256_0 ( )
Value:
#define MkBufferCreate256(...)

Definition at line 290 of file kernel_overload_mk.h.

◆ MkBufferCreate256_NULL

#define MkBufferCreate256_NULL ( ...)
Value:

Definition at line 288 of file kernel_overload_mk.h.

◆ MkBufferCreate64

#define MkBufferCreate64 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreate64_RT(MK_RT mkrt, MK_NUM const size)
call the BufferCreate with default type MkBuffer64S (64 byte) …

Definition at line 292 of file kernel_overload_mk.h.

◆ MkBufferCreate64_0

#define MkBufferCreate64_0 ( )
Value:
#define MkBufferCreate64(...)

Definition at line 293 of file kernel_overload_mk.h.

◆ MkBufferCreate64_NULL

#define MkBufferCreate64_NULL ( ...)
Value:

Definition at line 291 of file kernel_overload_mk.h.

◆ MkBufferCreate_0

#define MkBufferCreate_0 ( )
Value:
#define MkBufferCreate(...)

Definition at line 284 of file kernel_overload_mk.h.

◆ MkBufferCreate_1

#define MkBufferCreate_1 ( size)
Value:
MkBufferCreate(NULL,size)

Definition at line 283 of file kernel_overload_mk.h.

◆ MkBufferCreate_NULL

#define MkBufferCreate_NULL ( ...)
Value:

Definition at line 281 of file kernel_overload_mk.h.

◆ MkBufferCreateBIN

#define MkBufferCreateBIN ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateBIN_RT(MK_RT mkrt, MkBinaryR const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 295 of file kernel_overload_mk.h.

◆ MkBufferCreateBIN_NULL

#define MkBufferCreateBIN_NULL ( ...)
Value:

Definition at line 294 of file kernel_overload_mk.h.

◆ MkBufferCreateBOL

#define MkBufferCreateBOL ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateBOL_RT(MK_RT mkrt, MK_BOL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 297 of file kernel_overload_mk.h.

◆ MkBufferCreateBOL_NULL

#define MkBufferCreateBOL_NULL ( ...)
Value:

Definition at line 296 of file kernel_overload_mk.h.

◆ MkBufferCreateBUF

#define MkBufferCreateBUF ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateBUF_RT(MK_RT mkrt, MK_BUFN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 299 of file kernel_overload_mk.h.

◆ MkBufferCreateBUF_NULL

#define MkBufferCreateBUF_NULL ( ...)
Value:

Definition at line 298 of file kernel_overload_mk.h.

◆ MkBufferCreateDBL

#define MkBufferCreateDBL ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateDBL_RT(MK_RT mkrt, MK_DBL const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 301 of file kernel_overload_mk.h.

◆ MkBufferCreateDBL_NULL

#define MkBufferCreateDBL_NULL ( ...)
Value:

Definition at line 300 of file kernel_overload_mk.h.

◆ MkBufferCreateFLT

#define MkBufferCreateFLT ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateFLT_RT(MK_RT mkrt, MK_FLT const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 303 of file kernel_overload_mk.h.

◆ MkBufferCreateFLT_NULL

#define MkBufferCreateFLT_NULL ( ...)
Value:

Definition at line 302 of file kernel_overload_mk.h.

◆ MkBufferCreateI16

#define MkBufferCreateI16 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateI16_RT(MK_RT mkrt, MK_I16 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 305 of file kernel_overload_mk.h.

◆ MkBufferCreateI16_NULL

#define MkBufferCreateI16_NULL ( ...)
Value:

Definition at line 304 of file kernel_overload_mk.h.

◆ MkBufferCreateI32

#define MkBufferCreateI32 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateI32_RT(MK_RT mkrt, MK_I32 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 307 of file kernel_overload_mk.h.

◆ MkBufferCreateI32_NULL

#define MkBufferCreateI32_NULL ( ...)
Value:

Definition at line 306 of file kernel_overload_mk.h.

◆ MkBufferCreateI64

#define MkBufferCreateI64 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateI64_RT(MK_RT mkrt, MK_I64 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 309 of file kernel_overload_mk.h.

◆ MkBufferCreateI64_NULL

#define MkBufferCreateI64_NULL ( ...)
Value:

Definition at line 308 of file kernel_overload_mk.h.

◆ MkBufferCreateI8

#define MkBufferCreateI8 ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateI8_RT(MK_RT mkrt, MK_I8 const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 311 of file kernel_overload_mk.h.

◆ MkBufferCreateI8_NULL

#define MkBufferCreateI8_NULL ( ...)
Value:

Definition at line 310 of file kernel_overload_mk.h.

◆ MkBufferCreateLOCAL_T

#define MkBufferCreateLOCAL_T ( cls,
name,
size )
Value:
cls##R name##R = {0}; \
struct MkBufferS * const name = MkBUF(&name##R); \
MkBufferInit(name,cls##_TT,size)
#define MkBUF(x)
cast a known-object into an MkBufferS pointer
The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE …
MK_NUM size
the size of the data-segment

create an new MkBufferC object as L)ocal S)torage…

The cls argument is: MkBuffer64S 64 bytes, MkBuffer256S = 256 bytes, MkBuffer1024S = 1024 bytes,

hint
access string with bufR.super.buf.storage.first.C
Parameters
[in]clsA subclass of MkBufferS with predefined ILS storage → MkBuffer64S, MkBuffer256S and MkBuffer1024S
namethe name of the new MkBufferC
sizethe initial size of the new MkBufferC
6128#define MkBufferCreateLOCAL_T(cls,name,size) \
6129 cls##R name##R = {0}; \
6130 struct MkBufferS * const name = MkBUF(&name##R); \
6131 MkBufferInit(name,cls##_TT,size)

Definition at line 6128 of file LibMkKernel_mk.h.

6128#define MkBufferCreateLOCAL_T(cls,name,size) \
6129 cls##R name##R = {0}; \
6130 struct MkBufferS * const name = MkBUF(&name##R); \
6131 MkBufferInit(name,cls##_TT,size)

◆ MkBufferCreateSTR

#define MkBufferCreateSTR ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateSTR_RT(MK_RT mkrt, MK_STRN const val)
Constructor - create a new MkBufferC with an PRIMITIVE TYPE …

Definition at line 313 of file kernel_overload_mk.h.

◆ MkBufferCreateSTR_NULL

#define MkBufferCreateSTR_NULL ( ...)
Value:

Definition at line 312 of file kernel_overload_mk.h.

◆ MkBufferCreateTLS

#define MkBufferCreateTLS ( ...)
Value:
MK_EXTERN MK_BUF MkBufferCreateTLS_RT(MK_RT mkrt, MK_STRN const tlsName, bool const resetB)
same as BufferCreate but require no cleanup

Definition at line 320 of file kernel_overload_mk.h.

◆ MkBufferCreateTLS_1

#define MkBufferCreateTLS_1 ( tlsName)
Value:
MkBufferCreateTLS(tlsName,true)
#define MkBufferCreateTLS(...)

Definition at line 321 of file kernel_overload_mk.h.

◆ MkBufferCreateTLS_inout_T

#define MkBufferCreateTLS_inout_T ( cls,
name,
inout )
Value:
static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
if (likely(!__MkCheckX(MkBufferC,name))) { \
MkBufferInit(name,cls##_TT,0); \
MkRefIncr_1X(name); \
} else if (name->var.cursize) { \
MkBufferReset(name); \
} \
#define likely(x)
#define __MkCheckX(cls, x)
#define MkThreadLocal
struct MkBufferS::@4 var
variable part of the instance-data
MK_NUM cursize
currently used size (always: cursize < size)

Constructs a MkBufferC instance as T)hread L)ocal S)torage OR reuse inout if possible…

Same as MkBufferCreateTLS_T but try to reuse an already existsing inout. If inout is a MK_NULL pointer than a pointer to a local-reference is returned.

6101#define MkBufferCreateTLS_inout_T(cls,name,inout) \
6102 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
6103 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
6104 if (likely(!__MkCheckX(MkBufferC,name))) { \
6105 MkBufferInit(name,cls##_TT,0); \
6106 MkRefIncr_1X(name); \
6107 } else if (name->var.cursize) { \
6108 MkBufferReset(name); \
6109 } \

Definition at line 6101 of file LibMkKernel_mk.h.

6101#define MkBufferCreateTLS_inout_T(cls,name,inout) \
6102 static MkThreadLocal struct MkBufferS __hidden_##name##R = {0}; \
6103 MK_BUF name = *inout != NULL ? *inout : &__hidden_##name##R; \
6104 if (likely(!__MkCheckX(MkBufferC,name))) { \
6105 MkBufferInit(name,cls##_TT,0); \
6106 MkRefIncr_1X(name); \
6107 } else if (name->var.cursize) { \
6108 MkBufferReset(name); \
6109 } \
6110// [MkBufferCreateTLS_inout_T]

◆ MkBufferCreateTLS_NULL

#define MkBufferCreateTLS_NULL ( ...)
Value:

Definition at line 319 of file kernel_overload_mk.h.

◆ MkBufferCreateTLS_T

#define MkBufferCreateTLS_T ( cls,
name,
size )
Value:
static MkThreadLocal cls##R name##R = {0}; \
MK_BUF name = MkBUF(&name##R); \
if (unlikely(!__MkCheckX(cls,&name##R))) { \
MkBufferInit(name,cls##_TT,size); \
MkRefIncr_1X(name); \
} else if (MkBUF_R(&name##R).var.cursize) { \
MkBufferReset(name); \
}
#define MkBUF_R(x)
cast a known-object into an MkBufferS reference
#define unlikely(x)

create an new MkBufferC object as T)hread L)ocal S)torage…

The cls argument is: MkBuffer64S 64 bytes, MkBuffer256S = 256 bytes, MkBuffer1024S = 1024 bytes,

Parameters
[in]clsA subclass of MkBufferS with predefined ILS storage → MkBuffer64S, MkBuffer256S and MkBuffer1024S
namethe name of the new MkBufferC
sizethe initial size of the new MkBufferC
Note
This function is intended as a replacement for MkBufferCreateTLS for the C programming language.
6081#define MkBufferCreateTLS_T(cls,name,size) \
6082 static MkThreadLocal cls##R name##R = {0}; \
6083 MK_BUF name = MkBUF(&name##R); \
6084 if (unlikely(!__MkCheckX(cls,&name##R))) { \
6085 MkBufferInit(name,cls##_TT,size); \
6086 MkRefIncr_1X(name); \
6087 } else if (MkBUF_R(&name##R).var.cursize) { \
6088 MkBufferReset(name); \
6089 }

Definition at line 6081 of file LibMkKernel_mk.h.

6081#define MkBufferCreateTLS_T(cls,name,size) \
6082 static MkThreadLocal cls##R name##R = {0}; \
6083 MK_BUF name = MkBUF(&name##R); \
6084 if (unlikely(!__MkCheckX(cls,&name##R))) { \
6085 MkBufferInit(name,cls##_TT,size); \
6086 MkRefIncr_1X(name); \
6087 } else if (MkBUF_R(&name##R).var.cursize) { \
6088 MkBufferReset(name); \
6089 }

◆ MkBufferDelete

#define MkBufferDelete ( x)
Value:
MK_EXTERN void MkBufferDelete_RT(MK_RT mkrt, MK_BUF const buf)
Destructor - delete a MkBufferC instance …
#define MkObjectDeleteToNull(fct, NS, x)

Definition at line 316 of file kernel_overload_mk.h.

◆ MkBufferDup

#define MkBufferDup ( ...)
Value:
MK_EXTERN MK_BUF MkBufferDup_RT(MK_RT mkrt, MK_BUFN const buf)
Dup-Constructor - create a new MkBufferC instance as copy from an existing MkBufferC instance

Definition at line 278 of file kernel_overload_mk.h.

◆ MkBufferDup_NULL

#define MkBufferDup_NULL ( ...)
Value:

Definition at line 277 of file kernel_overload_mk.h.

◆ MkBufferFree

#define MkBufferFree ( ...)
Value:
MK_EXTERN void MkBufferFree_RT(MK_RT mkrt, MK_BUF const buf)
initialize or free an MkBufferC reference-instance …

Definition at line 325 of file kernel_overload_mk.h.

◆ MkBufferFree_NULL

#define MkBufferFree_NULL ( ...)
Value:

Definition at line 324 of file kernel_overload_mk.h.

◆ MkBufferInit

#define MkBufferInit ( ...)
Value:
MK_EXTERN void MkBufferInit_RT(MK_RT mkrt, MK_BUF const buf, MK_TYP type, MK_NUM const size)
initialize or free an MkBufferC reference-instance …

Definition at line 327 of file kernel_overload_mk.h.

◆ MkBufferInit_1

#define MkBufferInit_1 ( buf)
Value:
MkBufferInit(buf,NULL,0)
#define MkBufferInit(...)

Definition at line 329 of file kernel_overload_mk.h.

◆ MkBufferInit_2

#define MkBufferInit_2 ( buf,
size )
Value:
MkBufferInit(buf,NULL,size)

Definition at line 328 of file kernel_overload_mk.h.

◆ MkBufferInit_NULL

#define MkBufferInit_NULL ( ...)
Value:

Definition at line 326 of file kernel_overload_mk.h.

◆ MkBufferMerge

#define MkBufferMerge ( ...)
Value:
MK_EXTERN MK_BUF MkBufferMerge_RT(MK_RT mkrt, MK_BUF const buf)
Merge-Constructor - create a new MkBufferC as a merge from an existing object …

Definition at line 274 of file kernel_overload_mk.h.

◆ MkBufferMerge_NULL

#define MkBufferMerge_NULL ( ...)
Value:

Definition at line 273 of file kernel_overload_mk.h.

Function Documentation

◆ MkBufferCreate1024_RT()

MK_EXTERN MK_BUF MkBufferCreate1024_RT ( MK_RT mkrt,
MK_NUM const size )

call the BufferCreate with default type MkBuffer1024S (1024 byte) …

◆ MkBufferCreate256_RT()

MK_EXTERN MK_BUF MkBufferCreate256_RT ( MK_RT mkrt,
MK_NUM const size )

call the BufferCreate with default type MkBuffer256S (256 byte) …

◆ MkBufferCreate64_RT()

MK_EXTERN MK_BUF MkBufferCreate64_RT ( MK_RT mkrt,
MK_NUM const size )

call the BufferCreate with default type MkBuffer64S (64 byte) …

◆ MkBufferCreate_RT()

MK_EXTERN MK_BUF MkBufferCreate_RT ( MK_RT mkrt,
MK_TYP type,
MK_NUM const size )

Constructor - create a new MkBufferC with minimum size of internal storage …

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

There is a MkBufferCreateTT function for every PRIMITIVE TYPE.

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]typeA type defined as MkTypeS with a TT postfix (default: MkBuffer64S, possible: MkBuffer64S, MkBuffer256S and MkBuffer1024S)
[in]sizeThe initial size of the instance-local-storage. The MkBufferC has dynamic-memory-management, the size value is just a hint to provide enought memory for future tasks. The real size created is the maximum of type-ILS-size and size . (default: 0 = use the type-ILS-size)
Returns
The newly created MkBufferC instance, the instance is owned by the caller
See also
BufferDelete BufferDup MqReadBUF

◆ MkBufferCreateBIN_RT()

MK_EXTERN MK_BUF MkBufferCreateBIN_RT ( MK_RT mkrt,
MkBinaryR const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateBOL_RT()

MK_EXTERN MK_BUF MkBufferCreateBOL_RT ( MK_RT mkrt,
MK_BOL const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateBUF_RT()

MK_EXTERN MK_BUF MkBufferCreateBUF_RT ( MK_RT mkrt,
MK_BUFN const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateDBL_RT()

MK_EXTERN MK_BUF MkBufferCreateDBL_RT ( MK_RT mkrt,
MK_DBL const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateFLT_RT()

MK_EXTERN MK_BUF MkBufferCreateFLT_RT ( MK_RT mkrt,
MK_FLT const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateI16_RT()

MK_EXTERN MK_BUF MkBufferCreateI16_RT ( MK_RT mkrt,
MK_I16 const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateI32_RT()

MK_EXTERN MK_BUF MkBufferCreateI32_RT ( MK_RT mkrt,
MK_I32 const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateI64_RT()

MK_EXTERN MK_BUF MkBufferCreateI64_RT ( MK_RT mkrt,
MK_I64 const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateI8_RT()

MK_EXTERN MK_BUF MkBufferCreateI8_RT ( MK_RT mkrt,
MK_I8 const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateLOCAL_T()

void MkBufferCreateLOCAL_T ( MK_MACRO_TYP cls,
MK_MACRO_TYP name,
MK_NUM const size )

◆ MkBufferCreateSTR_RT()

MK_EXTERN MK_BUF MkBufferCreateSTR_RT ( MK_RT mkrt,
MK_STRN const val )

Constructor - create a new MkBufferC with an PRIMITIVE TYPE

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

Returns
The newly created MkBufferC instance, the instance is owned by the caller
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]valthe PRIMITIVE TYPE object as data-source

◆ MkBufferCreateTLS_inout_T()

void MkBufferCreateTLS_inout_T ( MK_MACRO_TYP cls,
MK_MACRO_TYP name,
MK_BUF * inout )

◆ MkBufferCreateTLS_RT()

MK_EXTERN MK_BUF MkBufferCreateTLS_RT ( MK_RT mkrt,
MK_STRN const tlsName,
bool const resetB )

same as BufferCreate but require no cleanup

  • A TLS-instance only exists ONCE per thread and ONCE per tlsName in memory.
  • The memory will be reused and must not be freed.
  • If resetB is false (default) than no reset is done
Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]tlsNameAn per-thread unique name (string) to identify the reuse-able instance-storage. if tlsName is MK_NULL or "" than a MK_NULL is returned
[in]resetBshould the new object be reset?
Returns
the new MkBufferC instance, the instance belongs to the TLS-function and does not need to be deleted.
Note
This function is intended as a replacement for MkBufferCreateTLS_T for non-C programming languages.
Attention
for usage of the TLS-storage read more at StorageCreateTLS

◆ MkBufferCreateTLS_T()

void MkBufferCreateTLS_T ( MK_MACRO_TYP cls,
MK_MACRO_TYP name,
MK_NUM const size )

◆ MkBufferDelete_RT()

MK_EXTERN void MkBufferDelete_RT ( MK_RT mkrt,
MK_BUF const buf )

Destructor - delete a MkBufferC instance …

There are two different ways to delete an instance:

ObjectDisposeto free the internal data but keep the outher shell alive - this is called a SOFT-DELETE
ObjectDelete to delete the outher shell including the internal data - this is called a HARD-DELETE
Attention
  1. The internal memory will be freed and the object-pointer will be set to NULL. If the object-pointer is already NULL nothing will be done.
  2. For a programming language without HARD-Delete support, the "Delete" method is assigned to a SOFT-Delete.
  3. For a programming language without garbage collection, a SOFT-delete without a HARD-delete causes a small memory loss (C++: ~32 bytes).
  4. After a SOFT-delete, the outher shell is still alive, but cannot be used. Any access to this shell generates an HDL-null-exception, but this exception can be caught. This is important for C++ as it prevents a core dump.
  5. On HARD-delete read more at MkSelfDeleteForce
See also
BufferCreate BufferDup MqReadBUF

◆ MkBufferDup_RT()

MK_EXTERN MK_BUF MkBufferDup_RT ( MK_RT mkrt,
MK_BUFN const buf )

Dup-Constructor - create a new MkBufferC instance as copy from an existing MkBufferC instance

The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferDelete is always possible, but the instance can no longer be used afterwards.

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 newly created MkBufferC instance, the instance is owned by the caller
See also
MkObjDup MkBufferDelete

◆ MkBufferFree_RT()

MK_EXTERN void MkBufferFree_RT ( MK_RT mkrt,
MK_BUF const buf )

initialize or free an MkBufferC reference-instance

Example: create a buffer-reference with default size (ILS) of 64 bytes.

MkBuffer64CR bufR = {0}; // MkBuffer64CR = typedef struct MkBuffer64S
MK_BUF const buf = MkBUF(&bufR); // get the POINTER from a REFERENCE
MkBufferInit(buf,MkBuffer64C_TT,0); // MkBufferInit operate on POINTER
...
// or use the predefined template-macro
MkBufferCreateLOCAL_T(MkBuffer64C,buf,0);
...
// finally free the memory, free is *only* done if internal memory-manager have switched to *heap* storage.
MkBufferFree(buf);
#define MkBuffer64C_TT
class as MkTypeS-class-type, useable in a class-macro as: class##_TT …
the final class of MkBufferS with 64 byte ILS-Size …
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 - attention: have to be initialised with '\0'

◆ MkBufferInit_RT()

MK_EXTERN void MkBufferInit_RT ( MK_RT mkrt,
MK_BUF const buf,
MK_TYP type,
MK_NUM const size )

initialize or free an MkBufferC reference-instance

Example: create a buffer-reference with default size (ILS) of 64 bytes.

MkBuffer64CR bufR = {0}; // MkBuffer64CR = typedef struct MkBuffer64S
MK_BUF const buf = MkBUF(&bufR); // get the POINTER from a REFERENCE
MkBufferInit(buf,MkBuffer64C_TT,0); // MkBufferInit operate on POINTER
...
// or use the predefined template-macro
MkBufferCreateLOCAL_T(MkBuffer64C,buf,0);
...
// finally free the memory, free is *only* done if internal memory-manager have switched to *heap* storage.
MkBufferFree(buf);
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 - attention: have to be initialised with '\0'
[in]typeA type defined as MkTypeS with a TT postfix - (default: NULL=MkBuffer64S)
[in]sizeThe initial size of the instance-local-storage. The MkBufferC has dynamic-memory-management, the size value is just a hint to provide enought memory for future tasks. The real size created is the maximum of type-ILS-size and size . (default: 0 = use the type-ILS-size)

◆ MkBufferMerge_RT()

MK_EXTERN MK_BUF MkBufferMerge_RT ( MK_RT mkrt,
MK_BUF const buf )

Merge-Constructor - create a new MkBufferC as a merge from an existing object …

The Merge-Constructor create a new instance and merge all internal data from the src into the new instance. After the Merge-Constructor the BufferResetFull is called for the merge-source bus.

One usage of the Merge-Constructor is to get a lightweight-copy of a Thread-Local-Storage object for external usage.

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 new instance or MK_NULL on error or if no Merge-Constructor is available
Attention
The new instance have to be deleted with BufferDelete
See also
BufferDup BufferResetFull BufferDelete