MkBufferStreamC - various functions to create and destroy a MkBufferStreamC … More...
Macros | |
#define | MkBufferStreamCreateLOCAL_T(cls, name, size) |
Constructs a MkBufferStreamC instance as L)ocal S)torage … | |
#define | MkBufferStreamCreateSTATIC_T(cls, name) |
Constructs a MkBufferStreamC instance as S)tatic S)torage … | |
#define | MkBufferStreamCreateTLS_T(cls, name) |
Constructs a MkBufferStreamC instance as T)hread L)ocal S)torage … | |
MkBufferStreamC - various functions to create and destroy a MkBufferStreamC …
#define MkBufferStreamCreate | ( | ... | ) |
Definition at line 824 of file kernel_overload_mk.h.
#define MkBufferStreamCreate1024 | ( | ... | ) |
Definition at line 828 of file kernel_overload_mk.h.
#define MkBufferStreamCreate1024_0 | ( | ) |
Definition at line 829 of file kernel_overload_mk.h.
#define MkBufferStreamCreate1024_NULL | ( | ... | ) |
Definition at line 827 of file kernel_overload_mk.h.
#define MkBufferStreamCreate16384 | ( | ... | ) |
Definition at line 831 of file kernel_overload_mk.h.
#define MkBufferStreamCreate16384_0 | ( | ) |
Definition at line 832 of file kernel_overload_mk.h.
#define MkBufferStreamCreate16384_NULL | ( | ... | ) |
Definition at line 830 of file kernel_overload_mk.h.
#define MkBufferStreamCreate256 | ( | ... | ) |
Definition at line 834 of file kernel_overload_mk.h.
#define MkBufferStreamCreate256_0 | ( | ) |
Definition at line 835 of file kernel_overload_mk.h.
#define MkBufferStreamCreate256_NULL | ( | ... | ) |
Definition at line 833 of file kernel_overload_mk.h.
#define MkBufferStreamCreate64 | ( | ... | ) |
Definition at line 837 of file kernel_overload_mk.h.
#define MkBufferStreamCreate64_0 | ( | ) |
Definition at line 838 of file kernel_overload_mk.h.
#define MkBufferStreamCreate64_NULL | ( | ... | ) |
Definition at line 836 of file kernel_overload_mk.h.
#define MkBufferStreamCreate_0 | ( | ) |
Definition at line 826 of file kernel_overload_mk.h.
#define MkBufferStreamCreate_1 | ( | size | ) |
Definition at line 825 of file kernel_overload_mk.h.
#define MkBufferStreamCreate_1 | ( | size | ) |
Definition at line 8014 of file LibMkKernel_mk.h.
#define MkBufferStreamCreate_NULL | ( | ... | ) |
Definition at line 823 of file kernel_overload_mk.h.
#define MkBufferStreamCreateLOCAL_T | ( | cls, | |
name, | |||
size ) |
Constructs a MkBufferStreamC instance as L)ocal S)torage …
[in] | cls | A subclass of MkBufferStreamS with predefined ILS storage → MkBufferStream16384S, MkBufferStream256S, MkBufferStream64S and MkBufferStream1024S |
name | the name of the new MkBufferStreamS instance | |
size | the minimum ILS storage to provide, if size exceed the predefined-storage from cls than heap-storage will be use. |
Definition at line 8076 of file LibMkKernel_mk.h.
#define MkBufferStreamCreateSTATIC_T | ( | cls, | |
name ) |
Constructs a MkBufferStreamC instance as S)tatic S)torage …
[in] | cls | A subclass of MkBufferStreamS with predefined ILS storage → MkBufferStream16384S, MkBufferStream256S, MkBufferStream64S and MkBufferStream1024S |
name | the name of the new MkBufferStreamS instance |
Definition at line 8092 of file LibMkKernel_mk.h.
#define MkBufferStreamCreateTLS | ( | ... | ) |
Definition at line 845 of file kernel_overload_mk.h.
#define MkBufferStreamCreateTLS_1 | ( | tlsName | ) |
Definition at line 846 of file kernel_overload_mk.h.
#define MkBufferStreamCreateTLS_NULL | ( | ... | ) |
Definition at line 844 of file kernel_overload_mk.h.
#define MkBufferStreamCreateTLS_T | ( | cls, | |
name ) |
Constructs a MkBufferStreamC instance as T)hread L)ocal S)torage …
[in] | cls | A subclass of MkBufferStreamS with predefined ILS storage → MkBufferStream16384S, MkBufferStream256S, MkBufferStream64S and MkBufferStream1024S |
name | the name of the new MkBufferStreamS instance |
Definition at line 8112 of file LibMkKernel_mk.h.
#define MkBufferStreamDelete | ( | x | ) |
Definition at line 841 of file kernel_overload_mk.h.
#define MkBufferStreamDup | ( | ... | ) |
Definition at line 820 of file kernel_overload_mk.h.
#define MkBufferStreamDup_NULL | ( | ... | ) |
Definition at line 819 of file kernel_overload_mk.h.
#define MkBufferStreamFree | ( | ... | ) |
Definition at line 850 of file kernel_overload_mk.h.
#define MkBufferStreamFree_NULL | ( | ... | ) |
Definition at line 849 of file kernel_overload_mk.h.
#define MkBufferStreamInit | ( | ... | ) |
Definition at line 852 of file kernel_overload_mk.h.
#define MkBufferStreamInit_1 | ( | bus | ) |
Definition at line 854 of file kernel_overload_mk.h.
#define MkBufferStreamInit_2 | ( | bus, | |
size ) |
Definition at line 853 of file kernel_overload_mk.h.
#define MkBufferStreamInit_NULL | ( | ... | ) |
Definition at line 851 of file kernel_overload_mk.h.
#define MkBufferStreamMerge | ( | ... | ) |
Definition at line 816 of file kernel_overload_mk.h.
#define MkBufferStreamMerge_NULL | ( | ... | ) |
Definition at line 815 of file kernel_overload_mk.h.
call the BufferStreamCreate with default type MkBufferStream1024S (1024 byte) …
call the BufferStreamCreate with default type MkBufferStream16384S (16384 byte) …
call the BufferStreamCreate with default type MkBufferStream256S (256 byte) …
call the BufferStreamCreate with default type MkBufferStream64S (64 byte) …
create and initialize an MkBufferStreamC instance …
The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferStreamDelete is always possible, but the instance can no longer be used afterwards.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | type | A type defined as MkTypeS with a TT postfix (default: MkBufferStream1024S, possible: MkBufferStream16384S, MkBufferStream256S, MkBufferStream64S and MkBufferStream1024S) |
[in] | size | The initial size of the instance-local-storage. The MkBufferStreamC 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) |
void MkBufferStreamCreateLOCAL_T | ( | MK_MACRO_TYP | cls, |
MK_MACRO_TYP | name, | ||
MK_NUM const | size ) |
void MkBufferStreamCreateSTATIC_T | ( | MK_MACRO_TYP | cls, |
MK_MACRO_TYP | name ) |
same as BufferStreamCreate but require no cleanup …
Example from perfserver.c
→ performance test with TLS storage
static enum MkErrorE Ot_BUST ( MQ_SERVICE_CALL_ARGS ) { MK_BUS bus = MkBufferStreamCreateTLS_1( "perfserver-BUST" ); while (MqReadItemExists(mqctx)) { MkBufferStreamWriteBUF(bus,MqReadBUF_e(mqctx)); } MkBufferStreamPosToStart(bus); MqSendSTART_E (mqctx); while (MkBufferStreamReadItemExists(bus)) { MqSendBUF_E (mqctx, MkBufferStreamReadBUF_e (bus)); } error: return MqSendRETURN (mqctx); }
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | tlsName | An 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] | resetB | should the new object be reset? |
void MkBufferStreamCreateTLS_T | ( | MK_MACRO_TYP | cls, |
MK_MACRO_TYP | name ) |
Destructor - delete a MkBufferStreamC instance …
There are two different ways to delete an instance:
ObjectDispose | to 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 |
Dup-Constructor - create a new MkBufferStreamC instance as copy from an existing MkBufferStreamC instance …
The new instance belongs to the caller and may have to be released if necessary. A manual release using BufferStreamDelete is always possible, but the instance can no longer be used afterwards.
init and free a MkBufferStreamS reference
To proper use a reference the storage have to be be initialised with '\0'
.
The type argiment is a MkTypeS cast from a MkBufferStreamS subclass:
Example: create a local buffer-stream instance of type MkBufferStream1024S
Or to create a more compact code use the template :
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | bus | the MkBufferStreamS instance to work on |
init and free a MkBufferStreamS reference
To proper use a reference the storage have to be be initialised with '\0'
.
The type argiment is a MkTypeS cast from a MkBufferStreamS subclass:
Example: create a local buffer-stream instance of type MkBufferStream1024S
Or to create a more compact code use the template :
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | bus | the MkBufferStreamS instance to work on |
[in] | type | the MkTypeS instance to work on - class-type with base MkBufferStreamS - (default = MK_NULL = MkBufferStreamS) |
[in] | size | The size of bus argument |
Merge-Constructor - create a new MkBufferStreamC 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 BufferStreamResetFull 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.
[in] | mkrt | the MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only) |
[in] | bus | the MkBufferStreamS instance to work on - (nonnull) |
MK_NULL
on error or if no Merge-Constructor is available