theKernel 10.0
Loading...
Searching...
No Matches
csmkkernel.MkBufferC Class Reference

MkBufferC - the abstract class known as buf or buffer is used to create and manage dynamic, generic, mixed typed data. … More...

+ Inheritance diagram for csmkkernel.MkBufferC:
+ Collaboration diagram for csmkkernel.MkBufferC:

Public Member Functions

MkBufferC AppendC (string val)
  C#: MkBufferC buf.AppendC(string val) C-API
append a single string to a MkBufferC object …
 
MkBufferC AppendStringR (string val)
  C#: MkBufferC buf.AppendStringR(string val) C-API
append a single string to a MkBufferC object …
 
int Pop (string val)
  C#: int buf.Pop(string val) C-API
delete str from the MkBufferC
 
int Push (string val)
  C#: int buf.Push(string val) C-API
add str to the MkBufferC
 
new MkBufferC Next ()
  C#: MkBufferC buf.Next() C-API
get next instance from linked-list of MkBufferS type
 
new MkBufferC Prev ()
  C#: MkBufferC buf.Prev() C-API
get previous instance from linked-list of MkBufferS type
 
MkBufferListC GetBFL (MkBufferListC val_inout=null)
  C#: MkBufferListC buf.GetBFL(MkBufferListC val_inout = null) C-API
function to read an MkBufferListC from an MkBufferC object …
 
MkBufferC GetBUF ()
  C#: MkBufferC buf.GetBUF() C-API
get a val_out from a MkBufferC
 
byte[] GetBIN ()
  C#: doc_mk_cs_BufferGetBIN C-API
get a val_out from a MkBufferC
 
bool GetBOL ()
  C#: doc_mk_cs_BufferGetBOL C-API
get a val_out from a MkBufferC
 
double GetDBL ()
  C#: doc_mk_cs_BufferGetDBL C-API
get a val_out from a MkBufferC
 
float GetFLT ()
  C#: doc_mk_cs_BufferGetFLT C-API
get a val_out from a MkBufferC
 
short GetI16 ()
  C#: doc_mk_cs_BufferGetI16 C-API
get a val_out from a MkBufferC
 
int GetI32 ()
  C#: doc_mk_cs_BufferGetI32 C-API
get a val_out from a MkBufferC
 
long GetI64 ()
  C#: doc_mk_cs_BufferGetI64 C-API
get a val_out from a MkBufferC
 
byte GetI8 ()
  C#: doc_mk_cs_BufferGetI8 C-API
get a val_out from a MkBufferC
 
string GetSTR ()
  C#: doc_mk_cs_BufferGetSTR C-API
get a val_out from a MkBufferC
 
string GetStringR ()
  C#: string buf.GetStringR() C-API
get a val_out from a MkBufferC
 
char GetType1 ()
  C#: char buf.GetType1() C-API
return the type from a MkBufferC as single character value …
 
MkTypeE GetType2 ()
  C#: MkTypeE buf.GetType2() C-API
return the MkTypeE from a MkBufferC
 
string GetType3 ()
  C#: string buf.GetType3() C-API
return the type from a MkBufferC as single character string …
 
bool IsLocal ()
  C#: bool buf.IsLocal() C-API
Check if the MkBufferC is local (temporary), not local mean global
 
void LogS (string varname="buf", MkObjectC fmtobj=null, [CallerMemberName]string callfunc=null)
  C#: buf.LogS(string varname = "buf", MkObjectC fmtobj = null, [CallerMemberName]string callfunc = null) C-API
log the short MkBufferC object data to the MkLogFileC (default: stderr) …
 
MkBufferC Copy (MkBufferC srce)
  C#: MkBufferC buf.Copy(MkBufferC srce) C-API
copy the MkBufferC from srce to dest
 
MkBufferC Reset ()
  C#: MkBufferC buf.Reset() C-API
reset a MkBufferC to the length zero …
 
MkBufferC SizeAdd (int size)
  C#: MkBufferC buf.SizeAdd(int size) C-API
add size storage to the buf
 
MkBufferC SizeNew (int size)
  C#: MkBufferC buf.SizeNew(int size) C-API
alloc min size storage to the buf
 
MkBufferC Temp ()
  C#: MkBufferC buf.Temp() C-API
create a temporary copy of the MkBufferC buf …
 
void CastTo (MkTypeE typ)
  C#: buf.CastTo(MkTypeE typ) C-API
change the type of an MkBufferC to type
 
int Cmp (MkBufferC buf2)
  C#: int buf1.Cmp(MkBufferC buf2) C-API
compare TWO MkBufferC objects like strcmp do it for strings …
 
void ResetFull ()
  C#: buf.ResetFull() C-API
reset a MkBufferC to the length zero and free allocated storage…
 
MkBufferC SetBIN (byte[] val)
  C#: doc_mk_cs_BufferSetBIN C-API
Set the MkBufferC to the val
 
MkBufferC SetBOL (bool val)
  C#: doc_mk_cs_BufferSetBOL C-API
Set the MkBufferC to the val
 
MkBufferC SetBUF (MkBufferC val)
  C#: MkBufferC buf.SetBUF(MkBufferC val) C-API
Set the MkBufferC to the val
 
MkBufferC SetBinaryR (byte[] val)
  C#: MkBufferC buf.SetBinaryR(byte[] val) C-API
Set the MkBufferC to the val
 
MkBufferC SetDBL (double val)
  C#: doc_mk_cs_BufferSetDBL C-API
Set the MkBufferC to the val
 
MkBufferC SetFLT (float val)
  C#: doc_mk_cs_BufferSetFLT C-API
Set the MkBufferC to the val
 
MkBufferC SetI16 (short val)
  C#: doc_mk_cs_BufferSetI16 C-API
Set the MkBufferC to the val
 
MkBufferC SetI32 (int val)
  C#: doc_mk_cs_BufferSetI32 C-API
Set the MkBufferC to the val
 
MkBufferC SetI64 (long val)
  C#: doc_mk_cs_BufferSetI64 C-API
Set the MkBufferC to the val
 
MkBufferC SetI8 (byte val)
  C#: doc_mk_cs_BufferSetI8 C-API
Set the MkBufferC to the val
 
MkBufferC SetSTR (string val)
  C#: doc_mk_cs_BufferSetSTR C-API
Set the MkBufferC to the val
 
MkBufferC SetStringR (string val)
  C#: MkBufferC buf.SetStringR(string val) C-API
Set the MkBufferC to the val
 
MkBufferC Merge ()
  C#: [constructor] MkBufferC buf.Merge() C-API
Merge-Constructor - create a new MkBufferC as a merge from an existing object …
 
MkBufferC Dup ()
  C#: [constructor] MkBufferC buf.Dup() C-API
Dup-Constructor - create a new MkBufferC instance as copy from an existing MkBufferC instance
 
 MkBufferC (int size=0)
 CONSTRUCTOR.
 
object ToObject ()
  C#: object buf.ToObject() C-API
return the native language object from a MkBufferC
 
- Public Member Functions inherited from csmkkernel.MkObjectC
delegate void MkObjectDeleteSCB (string typeName, int typeHdl, int objHdl)
 implements the csmkkernel API object: public version from MkObjectDeleteSCB as method
 
void ErrorCheck (MkErrorE err)
 
bool Check ()
 
string ToNameOfClass ()
  C#: string obj.ToNameOfClass() C-API
Class-Slot - returns the C#-Class-Name of the obj as string
 
void HandleDelete ()
  C#: netObj.HandleDelete() C-API
Handle-Delete-Slot - delete a netObj from handle-storage …
 
bool HandleExists ()
  C#: bool obj.HandleExists() C-API
check if obj has already a handle defined…
 
Int32 HandleGet ()
  C#: Int32 obj.HandleGet() C-API
Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage
 
Int32 HandleGetOfType ()
  C#: Int32 obj.HandleGetOfType() C-API
Export-Slot - returns typeHdl of the obj .
 
Int32 HandleGetOr0 ()
  C#: Int32 obj.HandleGetOr0() C-API
return export-hdl or 0 in not created…
 
MkObjectC Next ()
  C#: MkObjectC obj.Next() C-API
get next instance from linked-list of MkObjectS type
 
MkObjectC Prev ()
  C#: MkObjectC obj.Prev() C-API
get previous instance from linked-list of MkObjectS type
 
void DbgDump (string message="var", [CallerMemberName]string callfunc=null)
  C#: obj.DbgDump(string message = "var", [CallerMemberName]string callfunc = null) C-API
debug: Dump a instance to stderr with LNG and MQ internal data…
 
void DbgL (string message, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
  C#: fmtobj.DbgL(string message, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) C-API
debug: write a instance-marker to the MkLogFileC (default: stderr) using the fmtobj as prefix …
 
void DbgLogC ([CallerMemberName]string callfunc=null)
  C#: obj.DbgLogC([CallerMemberName]string callfunc = null) C-API
debug: write a short-obj-summary to MkLogFileC (default: stderr) …
 
void DbgO ([CallerMemberName]string callfunc=null)
  C#: obj.DbgO([CallerMemberName]string callfunc = null) C-API
debug: write the object-details to MkLogFileC (default: stderr) …
 
void DbgSTACK (int skip=0, int num=-1, [CallerMemberName]string callfunc=null)
  C#: fmtobj.DbgSTACK(int skip = 0, int num = -1, [CallerMemberName]string callfunc = null) C-API
debug: write the stack-trace to MkLogFileC (default: stderr) …
 
void LogC (string message, int debug=0, [CallerMemberName]string callfunc=null)
  C#: fmtobj.LogC(string message, int debug = 0, [CallerMemberName]string callfunc = null) C-API
write a logging-message to MkLogFileC (default: stderr) using the internal format …
 
void LogHEX (string callfunc, byte[] data)
  C#: fmtobj.LogHEX(string callfunc, byte[] data) C-API
log binaray data as HEX into the MkLogFileC (default: stderr) …
 
void Log (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
  C#: obj.Log(MkObjectC fmtobj = null, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) C-API
Log-Slot - log a summary of an object to the MkLogFileC (default: stderr) target …
 
void LogLong (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
  C#: obj.LogLong(MkObjectC fmtobj = null, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) C-API
log the MkObjectS verbose into the MkLogFileC (default: stderr) …
 
void LogShort (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
  C#: obj.LogShort(MkObjectC fmtobj = null, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) C-API
log the MkObjectS into the MkLogFileC (default: stderr) …
 
void LogType (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
  C#: obj.LogType(MkObjectC fmtobj = null, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) C-API
log the tyoe of the MkObjectS into the MkLogFileC (default: stderr) …
 
MkErrorC ErrorCatch (Exception exception=null, [CallerMemberName]string callfunc=null)
  C#: MkErrorC obj.ErrorCatch(Exception exception = null, [CallerMemberName]string callfunc = null) C-API
convert a programming-language-error into an csmkkernel error …
 
MkErrorC ToError ()
  C#: MkErrorC obj.ToError() C-API
Error-Slot - return an error-object pre initialized with obj data.
 
bool IsNull ()
  C#: bool obj.IsNull() C-API
ckeck if the object is null
 
string ToName ()
  C#: string obj.ToName() C-API
Info-Slot - returns brief information about the obj as a string
 
string ToNameOfType ()
  C#: string obj.ToNameOfType() C-API
Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string
 
override string ToString ()
  C#: string inst.ToString() C-API
String-Slot - returns the string representation of the inst
 
int RefGet ()
 MkRefGetP
 
void SysKill (int pid, int signal)
 MkSysKill
 
int SysGetPid ()
 MkSysGetPid
 
void Dispose ()
  C#: [destructor] obj.Dispose() C-API
Dispose-Slot - untie the connection between the Native-C#-Instance and the csmkkernel-Instance.
 
void Delete ()
  C#: [destructor] obj.Delete() C-API
Delete-Slot - delete an instance.
 

Static Public Member Functions

static MkBufferC MkBufferC_ObjNew (IntPtr hdl)
 
new static MkBufferC HandleResolve (Int32 netHdl)
  C#: [static] MkBufferC MkBufferC.HandleResolve(Int32 netHdl) C-API
Handle-Resolve-Slot - return a MkBufferC from netHdl or null if invalid…
 
new static MkBufferC Instances ()
  C#: [static] MkBufferC MkBufferC.Instances() C-API
get head-instance from linked-list of MkBufferS type …
 
new static MkBufferC GetNull ()
  C#: [static] MkBufferC MkBufferC.GetNull() C-API
Null-Slot - return a MkBufferC typed NULL instance …
 
static MkBufferC Create (int size=0)
  C#: [constructor,static] MkBufferC MkBufferC.Create(int size = 0) C-API
Constructor - create a new MkBufferC with minimum size of internal storage …
 
static MkBufferC Create1024 (int size=0)
  C#: [constructor,static] MkBufferC MkBufferC.Create1024(int size = 0) C-API
call the BufferCreate with default type MkBuffer1024S (1024 byte) …
 
static MkBufferC Create256 (int size=0)
  C#: [constructor,static] MkBufferC MkBufferC.Create256(int size = 0) C-API
call the BufferCreate with default type MkBuffer256S (256 byte) …
 
static MkBufferC Create64 (int size=0)
  C#: [constructor,static] MkBufferC MkBufferC.Create64(int size = 0) C-API
call the BufferCreate with default type MkBuffer64S (64 byte) …
 
static MkBufferC CreateBIN (byte[] val)
  C#: doc_mk_cs_BufferCreateBIN C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateBOL (bool val)
  C#: doc_mk_cs_BufferCreateBOL C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateBUF (MkBufferC val)
  C#: [constructor,static] MkBufferC MkBufferC.CreateBUF(MkBufferC val) C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateDBL (double val)
  C#: doc_mk_cs_BufferCreateDBL C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateFLT (float val)
  C#: doc_mk_cs_BufferCreateFLT C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateI16 (short val)
  C#: doc_mk_cs_BufferCreateI16 C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateI32 (int val)
  C#: doc_mk_cs_BufferCreateI32 C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateI64 (long val)
  C#: doc_mk_cs_BufferCreateI64 C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateI8 (byte val)
  C#: doc_mk_cs_BufferCreateI8 C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateSTR (string val)
  C#: doc_mk_cs_BufferCreateSTR C-API
Constructor - create a new MkBufferC with an PRIMITIVE TYPE
 
static MkBufferC CreateTLS (string tlsName, bool resetB=true)
  C#: [static] MkBufferC MkBufferC.CreateTLS(string tlsName, bool resetB = true) C-API
same as BufferCreate but require no cleanup
 
- Static Public Member Functions inherited from csmkkernel.MkObjectC
static MkObjectC MkObjectC_ObjNew (IntPtr hdl)
 
static IntPtr getOBJ (string cls, MkObjectC obj)
 
static IntPtr getOBJ_null_allow (MkObjectC obj)
 
static MkObjectC HandleResolve (Int32 netHdl)
  C#: [static] MkObjectC MkObjectC.HandleResolve(Int32 netHdl) C-API
Handle-Resolve-Slot - return a MkObjectC from netHdl or null if invalid…
 
static void HandleDeleteByNetHdl (Int32 netHdl)
  C#: [static] MkObjectC.HandleDeleteByNetHdl(Int32 netHdl) C-API
Handle-Delete-Slot - delete a netHdl from handle-storage …
 
static MkObjectC Instances ()
  C#: [static] MkObjectC MkObjectC.Instances() C-API
get head-instance from linked-list of MkObjectS type …
 
static MkObjectC GetNull ()
  C#: [static] MkObjectC MkObjectC.GetNull() C-API
Null-Slot - return a MkObjectC typed NULL instance …
 
static void DbgM (string message, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
  C#: [static] MkObjectC.DbgM(string message, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) C-API
debug: write a static-marker to the MkLogFileC (default: stderr) …
 
static int SysHashI32 (string key, int length=-1)
 MkSysHashI32
 
static string SysHashSTR (string key, int length=-1)
 MkSysHashSTR
 
static void DeleteCallbackCleanup (string ident)
  C#: [static] MkObjectC.DeleteCallbackCleanup(string ident) C-API
cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup
 
static void DeleteCallbackSetup (string ident, MkObjectDeleteSCB callback=null, string filter=null)
  C#: [static] MkObjectC.DeleteCallbackSetup(string ident, MkObjectDeleteSCB callback = null, string filter = null) C-API
Create/Delete the instance-delete-callback
 
static int getPId ()
 
static int getTId ()
 
static string getStackTrace (int level=2)
 
static string getCallerProc (int level=2)
 
static int getCallerLine (int level=2)
 
static string getCallerFile (int level=2)
 

Static Protected Member Functions

static IntPtr CTOR (int size=0)
  C#: [constructor,static] MkBufferC MkBufferC.Create(int size = 0) C-API
Constructor - create a new MkBufferC with minimum size of internal storage …
 
- Static Protected Member Functions inherited from csmkkernel.MkObjectC
static object atomObjNew (Type type, ConstructorInfo ctor, IntPtr obj)
 
static object atomObjCreate (Type type, ConstructorInfo ctor, IntPtr obj)
 
static IntPtr atomSelfCreate (ConstructorInfo ctor, IntPtr obj, IntPtr env)
 
static object atomSelfNull (ConstructorInfo ctor)
 
static void atomSelfUnlink (IntPtr self, IntPtr env)
 
static ConstructorInfo getCtor (Type type)
 
static string Name (IntPtr mkrt, IntPtr obj)
  C#: string obj.ToName() C-API
Info-Slot - returns brief information about the obj as a string
 

Additional Inherited Members

- Protected Member Functions inherited from csmkkernel.MkObjectC
 MkObjectC (IntPtr obj)
 
 MkObjectC ()
 
virtual void Dispose (bool disposing)
 Support IDisposable.
 
- Protected Attributes inherited from csmkkernel.MkObjectC
IntPtr pmkrt = IntPtr.Zero
 
- Package Functions inherited from csmkkernel.MkObjectC
- Static Package Functions inherited from csmkkernel.MkObjectC
- Properties inherited from csmkkernel.MkObjectC
IntPtr hdl [get, set]
 
IntPtr hdl_null_allow [get, set]
 
IntPtr mkrt [get, set]
 

Detailed Description

MkBufferC - the abstract class known as buf or buffer is used to create and manage dynamic, generic, mixed typed data. …

The MkBufferC is used to store PRIMITIVE TYPE data. If csmkkernel is working on data… csmkkernel is working on an MkBufferC object or on a list of MkBufferC objects called MkBufferListC.

MkBufferC CLASS

The ABSTRACT-CLASS used to store a native-type-data-item defined by PRIMITIVE TYPE

C-Kernel-Details

The ABSTRACT-CLASS MkBufferS is used to store MkTypeE data in an MkBufferS::storage

A new MkBufferS is always preallocated with the predefined ILS-storage (MkBufferS::ils_data), but can switch to a MALLOC-storage if the storage requirements of the user exceed the predefined MkBufferS::ilsS::size.

‍A MkBufferS never run out of storage.

The basic goal of the ILS-storage technology is to minimize the usage of MALLOC, this mean that the MkBufferS::ilsS::size should be large enought to be sufficient for the user needs.

The following conditions must always be met for the ILS memory:

The ABSTRACT-CLASS MkBufferS is missing the ILS-storage, the FINAL-CLASSES are:

MkBuffer64C, MkBuffer256C and MkBuffer1024C

See also
MkBufferListC, MkBufferStreamC

MkBufferC CTOR / DTOR

command synonmym
[constructor,static] MkBufferC MkBufferC.Create(int size = 0) csmkkernel.MkBufferC(wide size = 0)
[destructor] buf.Delete() buf.Dispose()

Example from server.cs read a buffer-object and convert single-char-type-identifer to string.

    private void BUF2 () {
      SendSTART();
      for (int i=0; i<3; i++) {
	MkBufferC buf = ReadBUF();
	SendSTR(buf.GetType1().ToString());
	SendBUF(buf);
      }
      SendRETURN();
    }
See also
BufferGetType1 BufferGetType2 BufferGetType3

Definition at line 716 of file MkBufferC.cs.

Member Function Documentation

◆ MkBufferC_ObjNew()

static MkBufferC csmkkernel.MkBufferC.MkBufferC_ObjNew ( IntPtr hdl)
inlinestatic

Definition at line 34 of file MkBufferC.cs.

34 {
35 return hdl != IntPtr.Zero ? (MkBufferC) atomObjNew(typeof(MkBufferC), ctor, hdl) : MK_NULL.Value;
36 }
static object atomObjNew(Type type, ConstructorInfo ctor, IntPtr obj)
Definition MkObjectC.cs:189
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: