theKernel 10.0
Loading...
Searching...
No Matches
MkRuntimeC_cc.hh
Go to the documentation of this file.
1
9/* LABEL-INIT */
10
11#pragma once
12
13namespace ccmkkernel {
14
15 class MkRuntimeC;
16
19 typedef struct {
23
26 class MkRuntimeC : public MkObjectC {
27
28 friend class MkKernel;
29
30/* LABEL-START */
31
34
35 public:
36 static thread_local MkRuntimeC MK_NULL_REF;
37
38 private:
39
40 static MkRuntimeC* MkRuntimeC_GetSelf (MK_RT hdl) {
41 return (hdl != NULL ? static_cast<MkRuntimeC*>((*MkRuntimeC_X2obj(hdl)).self) : &MK_NULL_REF);
42 }
43
44 #ifdef MkRuntimeC_selfCreate_overload
45 static MK_PTR MkRuntimeC_selfCreate (MK_RT_ARGS MK_OBJ obj, MK_PTR const env);
46 #else
47 static MK_PTR MkRuntimeC_selfCreate (MK_RT_ARGS MK_OBJ obj, MK_PTR const env) {
48 return new MkRuntimeC(obj);
49 }
50 #endif
51
52 static void MkRuntimeC_selfDelete (MK_RT_ARGS MK_PTR self, MK_PTR env) {
53 delete static_cast<MkRuntimeC*>(self);
54 }
55
56 static void MkRuntimeC_selfUnlink (MK_RT_ARGS MK_PTR self, MK_PTR env) {
57 MkRuntimeC* selfO = static_cast<MkRuntimeC*>(self);
58 selfO->atomUnlink();
59 }
60
61 void MkRuntimeC_Init (MK_RT hdl) { atomInit(MkRuntimeC_X2obj(hdl)); };
62
63
64 static MkRuntimeC* MkRuntimeC_ObjCreate (MK_RT_ARGS MK_RT hdl) {
65 return static_cast<MkRuntimeC*>(MkObjectC::atomObjCreate(MK_RT_CALL MkRuntimeC_X2obj(hdl)));
66 }
67
68#ifndef META_IS_MkObjectC
69 MkRuntimeC (MK_OBJ obj) : MkObjectC(obj) {};
70#endif
71
72 public:
73
74#ifndef META_IS_MkObjectC
76#endif
77
82
84 MK_RT getRT() const {
85 MK_RT ret = reinterpret_cast<MK_RT>(hdl);
86 if (unlikely(ret == NULL)) InstHdlIsNullError();
87 return ret;
88 };
89
92 return reinterpret_cast<MK_RT>(hdl);
93 };
94
96 MK_RTN getRTN() const {
97 MK_RTN ret = reinterpret_cast<MK_RTN>(hdl);
98 if (unlikely(ret == NULL)) InstHdlIsNullError();
99 return ret;
100 };
101
104 return reinterpret_cast<MK_RTN>(hdl);
105 };
106
108 static MK_RT getRT(MkRuntimeC* clsHdl) {
109 MK_RT ret = clsHdl ? reinterpret_cast<MK_RT>(clsHdl->hdl) : NULL;
110 if (unlikely(ret == NULL)) ClassHdlIsNullError(MkRuntimeC);
111 return ret;
112 };
113
116 return clsHdl ? reinterpret_cast<MK_RT>(clsHdl->hdl) : NULL;
117 };
118
120 static MK_RTN getRTN(const MkRuntimeC* clsHdl) {
121 MK_RTN ret = clsHdl ? reinterpret_cast<MK_RTN>(clsHdl->hdl) : NULL;
122 if (unlikely(ret == NULL)) ClassHdlIsNullError(MkRuntimeC);
123 return ret;
124 };
125
127 static MK_RTN getRTN__null_allow(const MkRuntimeC* clsHdl) {
128 return clsHdl ? reinterpret_cast<MK_RTN>(clsHdl->hdl) : NULL;
129 };
130
132 static MK_RT getRT(const MkRuntimeC& clsHdl) {
133 return clsHdl.getRT();
134 };
135
137 static MK_RT getRT__null_allow(const MkRuntimeC& clsHdl) {
138 return clsHdl.getRT__null_allow();
139 };
140
142 static MK_RTN getRTN(const MkRuntimeC& clsHdl) {
143 return clsHdl.getRTN();
144 };
145
147 static MK_RTN getRTN__null_allow(const MkRuntimeC& clsHdl) {
148 return clsHdl.getRTN__null_allow();
149 };
150
152 bool Check() const {
153 return (hdl && MkRtCheck(hdl));
154 };
155
156/* LABEL-END */
157
158 private:
159
160 MkRuntimeC () {};
161
162 public:
163
164 // BEGIN-MkRuntimeC - created by 'cc_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
165
169
170 public:
171
172 // doc-key: MkRuntimeC,MkRuntimeC-Config,sm_,public
173
175 static MK_I32 DebugGet ();
176
178 static void DebugSet (MK_I32 dbg);
179
181 static MkErrorE ErrorGetCode ();
182
184 static MK_BOOL IsSilentGet ();
185
187 static void IsSilentSet (MK_BOOL silent);
188
190 static MK_STRN LogTargetGet ();
191
193 static void LogTargetReset ();
194
196 static void LogTargetSet (MK_STRN logTgt);
197
199 static void LogTargetSet (const std::string& logTgt);
200
202 static void NoDecoSet (MK_BOOL noDeco);
203
205 // MkRuntimeC_Config_CC_API
206
210
211 public:
212
213 // doc-key: MkRuntimeC,MkRuntimeC-Info,sm_,public
214
216 static void Log0 (const MkObjectC* fmtobj = NULL, MK_DBG debug = 0, MK_STRN callfunc = __builtin_FUNCTION(), MK_I32 lvl = 0);
217
219 static void Log0 (const MkObjectC& fmtobj, MK_DBG debug = 0, MK_STRN callfunc = __builtin_FUNCTION(), MK_I32 lvl = 0);
220
222 // MkRuntimeC_Info_CC_API
223
224 // END-MkRuntimeC - created by 'cc_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
225
227 };
228
229} // namespace ccmkkernel
#define InstHdlIsNullError()
#define ClassHdlIsNullError(cls)
MkKernel PACKAGE - The package is the toplevel structure of the Programming-Language-Micro-Kernel (PL...
object header … → C-API: libmkkernel::MkObjectS
The MkRuntimeS provide a per-thread environment for ccmkkernel … → C-API: libmkkernel::MkRuntimeS
#define unlikely(x)
MkErrorE
collection for the different error-codes …
bool MK_BOOL
real bool data-type
int32_t MK_NUM
array size data-type ('num' items in array …
int MK_DBG
debug-level data-type …
signed int MK_I32
4 byte integer data-type
MK_PTRB * MK_PTR
generic pointer data-type
const MK_STRB * MK_STRN
constant string pointer data-type
static MK_PTR atomObjCreate(MK_RT_ARGS MK_OBJ obj)
void atomInit(MK_OBJ obj)
static MK_PTR atomObjNew(MK_RT_ARGS MK_OBJ obj)
struct MkObjectS * MK_OBJ
class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
MK_RT getRT__null_allow() const
return the LibMsgqueObject from current MkRuntimeC instance
static MkRuntimeC * MkRuntimeC_ObjNew(MK_RT_ARGS MK_RT hdl)
return MkRuntimeC from LibMsgqueObject
static MK_RTN getRTN(const MkRuntimeC &clsHdl)
(const) return LibMsgqueObject from current MkRuntimeC reference
static MK_RT getRT__null_allow(const MkRuntimeC &clsHdl)
return LibMsgqueObject from current MkRuntimeC reference
static MK_RTN getRTN(const MkRuntimeC *clsHdl)
(const) return LibMsgqueObject from current MkRuntimeC pointer
static MK_RTN getRTN__null_allow(const MkRuntimeC &clsHdl)
(const) return LibMsgqueObject from current MkRuntimeC reference
bool Check() const
check if pointer is still valid
static thread_local MkRuntimeC MK_NULL_REF
MK_RTN getRTN() const
(const) return the LibMsgqueObject from current MkRuntimeC instance
MK_RTN getRTN__null_allow() const
(const) return the LibMsgqueObject from current MkRuntimeC instance
static MK_RT getRT(const MkRuntimeC &clsHdl)
return LibMsgqueObject from current MkRuntimeC reference
static MK_RT getRT__null_allow(MkRuntimeC *clsHdl)
return LibMsgqueObject from current MkRuntimeC pointer
MK_RT getRT() const
return the LibMsgqueObject from current MkRuntimeC instance
static MK_RT getRT(MkRuntimeC *clsHdl)
return LibMsgqueObject from current MkRuntimeC pointer
static MK_RTN getRTN__null_allow(const MkRuntimeC *clsHdl)
(const) return LibMsgqueObject from current MkRuntimeC pointer
struct MkRuntimeS * MK_RT
class-shortcut for struct MkRuntimeS *, all shortcut using the XX_YYY syntax (only for public API) …
static bool MkRtCheck(MK_MNGN mng)
check MkRuntimeS -> libmkkernel::MkObjectS::signature …
#define MkRuntimeC_X2obj(x)
static MK_BOOL IsSilentGet()
C++: [static] MK_BOOL MkRuntimeC::IsSilentGet() → C-API get the MkRuntimeS::isSilent value …
static void IsSilentSet(MK_BOOL silent)
C++: [static] MkRuntimeC::IsSilentSet(MK_BOOL silent) → C-API set the MkRuntimeS::isSilent value...
static MK_STRN LogTargetGet()
C++: [static] MK_STRN MkRuntimeC::LogTargetGet() → C-API get the MkLogDataS::logNAME value …
static void DebugSet(MK_I32 dbg)
C++: [static] MkRuntimeC::DebugSet(MK_I32 dbg) → C-API set the MkRuntimeS::debug value …
static void NoDecoSet(MK_BOOL noDeco)
C++: [static] MkRuntimeC::NoDecoSet(MK_BOOL noDeco) → C-API set the MkRuntimeS::noDeco value …
static MK_I32 DebugGet()
C++: [static] MK_I32 MkRuntimeC::DebugGet() → C-API get the MkRuntimeS::debug value …
static MkErrorE ErrorGetCode()
C++: [static] MkErrorE MkRuntimeC::ErrorGetCode() → C-API return libmkkernel::MkErrorS::code fro...
static void LogTargetReset()
C++: [static] MkRuntimeC::LogTargetReset() → C-API set the MkRuntimeS::log value to the DEFAULT ...
static void LogTargetSet(MK_STRN logTgt)
C++: [static] MkRuntimeC::LogTargetSet(MK_STRN logTgt) → C-API set the MkRuntimeS::log value and...
static void Log0(const MkObjectC *fmtobj=NULL, MK_DBG debug=0, MK_STRN callfunc=__builtin_FUNCTION(), MK_I32 lvl=0)
C++: [static] MkRuntimeC::Log0(const MkObjectC* fmtobj = NULL, MK_DBG debug = 0, MK_STRN callfunc = _...
#define MK_RT_CALL
#define MK_RT_ARGS
namespace for the CcMkKernel "C++"-API
The MkRuntimeS provide a per-thread environment for ccmkkernel … → C-API: libmkkernel::MkRuntimeS
The MkRuntimeS provide a per-thread environment for ccmkkernel …