theKernel 10.0
Loading...
Searching...
No Matches
MkObjectC_CC_API

MkObjectC - class known as obj or object is used as base-class type for a Programming-Language-Micro-Kernel (PLMK) class … More...

+ Collaboration diagram for MkObjectC_CC_API:

Topics

 MkObjectC_TOR_CC_API
 MkObjectC - create and destroy a managed-object
 
 MkObjectC_Obj_CC_API
 MkObjectC - managed-object details
 
 MkObjectC_Misc_CC_API
 MkObjectC - various functions related to the MkObjectS
 
 MkObjectC_Log_CC_API
 MkObjectC - log information to MkLogFileC (default: stderr) …
 
 MkObjectC_Dbg_CC_API
 MkObjectC - log a debugging-message to the MkLogFileC (default: stderr) …
 
 MkObjectC_Sys_CC_API
 MkObjectC - L)anguage A)bstraction L)ayer definition …
 
 MkObjectC_Introspection_CC_API
 
 MK_System_CC_API
 MkObjectC - L)anguage A)bstraction L)ayer definition …
 
 MkObjectC_Class_CC_API
 MkObjectC - define the class …
 

Classes

struct  ccmkkernel::MkObjectC_A
 object header … → C-API: libmkkernel::MkObjectS More...
 
class  ccmkkernel::MkObjectC
 object header … → C-API: libmkkernel::MkObjectS More...
 

Typedefs

typedef void(MkObjectC::*) ccmkkernel::MkObjectC::MkObjectDeleteICB(MK_STRN const, MK_HDL const, MK_HDL const)
 instance-callback
 
typedef void(*) ccmkkernel::MkObjectC::MkObjectDeleteCCB(MkObjectC *, MK_STRN const, MK_HDL const, MK_HDL const)
 class-callback
 

Functions

static MkObjectCccmkkernel::MkObjectC::MkObjectC_ObjNew (MK_RT_ARGS MK_OBJ hdl)
 return MkObjectC from LibMsgqueObject
 
MK_OBJ ccmkkernel::MkObjectC::getOBJ () const
 return the LibMsgqueObject from current MkObjectC instance
 
MK_OBJ ccmkkernel::MkObjectC::getOBJ__null_allow () const
 return the LibMsgqueObject from current MkObjectC instance
 
MK_OBJN ccmkkernel::MkObjectC::getOBJN () const
 (const) return the LibMsgqueObject from current MkObjectC instance
 
MK_OBJN ccmkkernel::MkObjectC::getOBJN__null_allow () const
 (const) return the LibMsgqueObject from current MkObjectC instance
 
static MK_OBJ ccmkkernel::MkObjectC::getOBJ (MkObjectC *clsHdl)
 return LibMsgqueObject from current MkObjectC pointer
 
static MK_OBJ ccmkkernel::MkObjectC::getOBJ__null_allow (MkObjectC *clsHdl)
 return LibMsgqueObject from current MkObjectC pointer
 
static MK_OBJN ccmkkernel::MkObjectC::getOBJN (const MkObjectC *clsHdl)
 (const) return LibMsgqueObject from current MkObjectC pointer
 
static MK_OBJN ccmkkernel::MkObjectC::getOBJN__null_allow (const MkObjectC *clsHdl)
 (const) return LibMsgqueObject from current MkObjectC pointer
 
static MK_OBJ ccmkkernel::MkObjectC::getOBJ (const MkObjectC &clsHdl)
 return LibMsgqueObject from current MkObjectC reference
 
static MK_OBJ ccmkkernel::MkObjectC::getOBJ__null_allow (const MkObjectC &clsHdl)
 return LibMsgqueObject from current MkObjectC reference
 
static MK_OBJN ccmkkernel::MkObjectC::getOBJN (const MkObjectC &clsHdl)
 (const) return LibMsgqueObject from current MkObjectC reference
 
static MK_OBJN ccmkkernel::MkObjectC::getOBJN__null_allow (const MkObjectC &clsHdl)
 (const) return LibMsgqueObject from current MkObjectC reference
 
bool ccmkkernel::MkObjectC::Check () const
 check if pointer is still valid
 
void ccmkkernel::MkObjectC::atomInit (MK_OBJ obj)
 
void ccmkkernel::MkObjectC::atomUnlink ()
 
 ccmkkernel::MkObjectC::MkObjectC ()
 
 ccmkkernel::MkObjectC::MkObjectC (MK_OBJ obj)
 
void ccmkkernel::MkObjectC::ErrorCheck (enum MkErrorE err, MK_STRN const caller=__builtin_FUNCTION(), MK_I32 const line=__builtin_LINE()) const
 
void ccmkkernel::MkObjectC::ErrorCheck (MK_STRN const caller=__builtin_FUNCTION(), MK_I32 const line=__builtin_LINE()) const
 
static void ccmkkernel::MkObjectC::ErrorCheck (MK_MNGN mng, enum MkErrorE err, MK_STRN const caller=__builtin_FUNCTION(), MK_I32 const line=__builtin_LINE())
 
static MK_PTR ccmkkernel::MkObjectC::atomObjNew (MK_RT_ARGS MK_OBJ obj)
 
static MK_PTR ccmkkernel::MkObjectC::atomObjCreate (MK_RT_ARGS MK_OBJ obj)
 
virtual ccmkkernel::MkObjectC::~MkObjectC ()
 
MK_MNG ccmkkernel::MkObjectC::getMNG () const
 
MK_STRN ccmkkernel::MkObjectC::ToNativeNameOfClass () const
 

Variables

static thread_local MkObjectC ccmkkernel::MkObjectC::MK_NULL_REF = {(MK_OBJ)0}
 
MK_OBJ ccmkkernel::MkObjectC::hdl = NULL
 
MK_RT ccmkkernel::MkObjectC::mkrt = NULL
 

Detailed Description

MkObjectC - class known as obj or object is used as base-class type for a Programming-Language-Micro-Kernel (PLMK) class …

ccmkkernel is also called as Programming-Language-Micro-Kernel (PLMK). ccmkkernel is like a programming-language without syntax but using the Target-Programming-Language (in our case C++) of the Micro-Kernel as runtime environment.

Integration
To operate as a Micro-Kernel a maximum integration into the Target-Programming-Language is available.

This integration is done using the managed-object-technology.

Managed-Object
A managed-object is a piece of C-Code able to act as a native datatype in all Target-Programming-Languages supported.

The managed object supports low level integration features descripted in MkObjectS :

In the implementation-layer of ccmkkernel only the public-features of the MkObjectC are visible to the programmer.

See also
For the full documentation read: Managed-Object

Typedef Documentation

◆ MkObjectDeleteCCB

void(*) ccmkkernel::MkObjectC::MkObjectDeleteCCB(MkObjectC *, MK_STRN const, MK_HDL const, MK_HDL const)

class-callback

Definition at line 224 of file MkObjectC_cc.hh.

◆ MkObjectDeleteICB

void(MkObjectC::*) ccmkkernel::MkObjectC::MkObjectDeleteICB(MK_STRN const, MK_HDL const, MK_HDL const)

instance-callback

Definition at line 223 of file MkObjectC_cc.hh.

Function Documentation

◆ atomInit()

void ccmkkernel::MkObjectC::atomInit ( MK_OBJ obj)
inlineprotected

Definition at line 171 of file MkObjectC_cc.hh.

171 {
172 hdl = obj;
173 if (obj != NULL) MkRefIncrSelf(hdl,this,NULL);
174#if META_HAS_THREAD
175 mkrt = MkRT_O(obj);
176#endif
177 }
static void MkRefIncrSelf(MK_OBJ const obj, MK_PTR const self, MK_PTR const env)
ATOMIC operation -> link self with reference-count.
#define MkRT_O(o)
+ Here is the caller graph for this function:

◆ atomObjCreate()

static MK_PTR ccmkkernel::MkObjectC::atomObjCreate ( MK_RT_ARGS MK_OBJ obj)
inlinestaticprotected

Definition at line 217 of file MkObjectC_cc.hh.

217 {
218 return MkSelfCreate(obj,NULL);
219 }
#define MkSelfCreate(...)

◆ atomObjNew()

static MK_PTR ccmkkernel::MkObjectC::atomObjNew ( MK_RT_ARGS MK_OBJ obj)
inlinestaticprotected

Definition at line 212 of file MkObjectC_cc.hh.

212 {
213 MK_PTR self = NULL;
214 ErrorCheck(obj, MkSelfNew(obj,&self,NULL));
215 return self;
216 }
MK_PTRB * MK_PTR
generic pointer data-type
void ErrorCheck(enum MkErrorE err, MK_STRN const caller=__builtin_FUNCTION(), MK_I32 const line=__builtin_LINE()) const
#define MkSelfNew(...)
+ Here is the caller graph for this function:

◆ atomUnlink()

void ccmkkernel::MkObjectC::atomUnlink ( )
inlineprotected

Definition at line 179 of file MkObjectC_cc.hh.

179 {
180 if (hdl) {
182 }
183 }
#define MkRefDecrWithoutSelf(...)

◆ Check()

bool ccmkkernel::MkObjectC::Check ( ) const
inline

check if pointer is still valid

Definition at line 157 of file MkObjectC_cc.hh.

157 {
158 return (hdl && MkObjCheck(hdl));
159 };
static bool MkObjCheck(MK_MNGN mng)
check MkObjectS -> libmkkernel::MkObjectS::signature …

◆ ErrorCheck() [1/3]

void ccmkkernel::MkObjectC::ErrorCheck ( enum MkErrorE err,
MK_STRN const caller = __builtin_FUNCTION(),
MK_I32 const line = __builtin_LINE() ) const
inlineprotected

Definition at line 192 of file MkObjectC_cc.hh.

195 {
196 if (MkErrorCheckI(err)) MkExceptionC::Raise(hdl, caller, line);
197 }
#define MkErrorCheckI(err)
static void Raise(MK_MNGN const expobj, MK_STRN const callfunc=__builtin_FUNCTION(), MK_I32 const callline=__builtin_LINE())
convert an MkErrorC into a Target-Programming-Language (TPL) exception … → C-API: libmkkernel::MkE...
+ Here is the caller graph for this function:

◆ ErrorCheck() [2/3]

static void ccmkkernel::MkObjectC::ErrorCheck ( MK_MNGN mng,
enum MkErrorE err,
MK_STRN const caller = __builtin_FUNCTION(),
MK_I32 const line = __builtin_LINE() )
inlinestaticprotected

Definition at line 203 of file MkObjectC_cc.hh.

207 {
208 if (MkErrorCheckI(err)) MkExceptionC::Raise(mng, caller, line);
209 }

◆ ErrorCheck() [3/3]

void ccmkkernel::MkObjectC::ErrorCheck ( MK_STRN const caller = __builtin_FUNCTION(),
MK_I32 const line = __builtin_LINE() ) const
inlineprotected

Definition at line 198 of file MkObjectC_cc.hh.

200 {
201 if (MkErrorCheckE_NULL()) MkExceptionC::Raise(hdl, caller, line);
202 }
#define MkErrorCheckE_NULL()

◆ getMNG()

MK_MNG ccmkkernel::MkObjectC::getMNG ( ) const
inline

Definition at line 235 of file MkObjectC_cc.hh.

235 {
236 MK_MNG ret = reinterpret_cast<MK_MNG>(hdl);
237 if (unlikely(ret == NULL)) throw std::runtime_error("MkObjectC* is NULL");
238 return ret;
239 };
#define unlikely(x)
MK_PTRB * MK_MNG
managed object pointer, datatype will be checked at runtime

◆ getOBJ() [1/3]

MK_OBJ ccmkkernel::MkObjectC::getOBJ ( ) const
inline

return the LibMsgqueObject from current MkObjectC instance

Definition at line 89 of file MkObjectC_cc.hh.

89 {
90 MK_OBJ ret = reinterpret_cast<MK_OBJ>(hdl);
91 if (unlikely(ret == NULL)) InstHdlIsNullError();
92 return ret;
93 };
#define InstHdlIsNullError()
struct MkObjectS * MK_OBJ
class-shortcut for struct MkObjectS *, all shortcut using the XX_YYY syntax (only for public API) …
+ Here is the caller graph for this function:

◆ getOBJ() [2/3]

static MK_OBJ ccmkkernel::MkObjectC::getOBJ ( const MkObjectC & clsHdl)
inlinestatic

return LibMsgqueObject from current MkObjectC reference

Definition at line 137 of file MkObjectC_cc.hh.

137 {
138 return clsHdl.getOBJ();
139 };

◆ getOBJ() [3/3]

static MK_OBJ ccmkkernel::MkObjectC::getOBJ ( MkObjectC * clsHdl)
inlinestatic

return LibMsgqueObject from current MkObjectC pointer

Definition at line 113 of file MkObjectC_cc.hh.

113 {
114 MK_OBJ ret = clsHdl ? reinterpret_cast<MK_OBJ>(clsHdl->hdl) : NULL;
115 if (unlikely(ret == NULL)) ClassHdlIsNullError(MkObjectC);
116 return ret;
117 };
#define ClassHdlIsNullError(cls)

◆ getOBJ__null_allow() [1/3]

MK_OBJ ccmkkernel::MkObjectC::getOBJ__null_allow ( ) const
inline

return the LibMsgqueObject from current MkObjectC instance

Definition at line 96 of file MkObjectC_cc.hh.

96 {
97 return reinterpret_cast<MK_OBJ>(hdl);
98 };
+ Here is the caller graph for this function:

◆ getOBJ__null_allow() [2/3]

static MK_OBJ ccmkkernel::MkObjectC::getOBJ__null_allow ( const MkObjectC & clsHdl)
inlinestatic

return LibMsgqueObject from current MkObjectC reference

Definition at line 142 of file MkObjectC_cc.hh.

142 {
143 return clsHdl.getOBJ__null_allow();
144 };

◆ getOBJ__null_allow() [3/3]

static MK_OBJ ccmkkernel::MkObjectC::getOBJ__null_allow ( MkObjectC * clsHdl)
inlinestatic

return LibMsgqueObject from current MkObjectC pointer

Definition at line 120 of file MkObjectC_cc.hh.

120 {
121 return clsHdl ? reinterpret_cast<MK_OBJ>(clsHdl->hdl) : NULL;
122 };

◆ getOBJN() [1/3]

MK_OBJN ccmkkernel::MkObjectC::getOBJN ( ) const
inline

(const) return the LibMsgqueObject from current MkObjectC instance

Definition at line 101 of file MkObjectC_cc.hh.

101 {
102 MK_OBJN ret = reinterpret_cast<MK_OBJN>(hdl);
103 if (unlikely(ret == NULL)) InstHdlIsNullError();
104 return ret;
105 };
const struct MkObjectS * MK_OBJN
class-shortcut for const struct MkObjectS *, all const shortcut using the XX_YYYC syntax (only for pu...
+ Here is the caller graph for this function:

◆ getOBJN() [2/3]

static MK_OBJN ccmkkernel::MkObjectC::getOBJN ( const MkObjectC & clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MkObjectC reference

Definition at line 147 of file MkObjectC_cc.hh.

147 {
148 return clsHdl.getOBJN();
149 };

◆ getOBJN() [3/3]

static MK_OBJN ccmkkernel::MkObjectC::getOBJN ( const MkObjectC * clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MkObjectC pointer

Definition at line 125 of file MkObjectC_cc.hh.

125 {
126 MK_OBJN ret = clsHdl ? reinterpret_cast<MK_OBJN>(clsHdl->hdl) : NULL;
127 if (unlikely(ret == NULL)) ClassHdlIsNullError(MkObjectC);
128 return ret;
129 };

◆ getOBJN__null_allow() [1/3]

MK_OBJN ccmkkernel::MkObjectC::getOBJN__null_allow ( ) const
inline

(const) return the LibMsgqueObject from current MkObjectC instance

Definition at line 108 of file MkObjectC_cc.hh.

108 {
109 return reinterpret_cast<MK_OBJN>(hdl);
110 };
+ Here is the caller graph for this function:

◆ getOBJN__null_allow() [2/3]

static MK_OBJN ccmkkernel::MkObjectC::getOBJN__null_allow ( const MkObjectC & clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MkObjectC reference

Definition at line 152 of file MkObjectC_cc.hh.

152 {
153 return clsHdl.getOBJN__null_allow();
154 };

◆ getOBJN__null_allow() [3/3]

static MK_OBJN ccmkkernel::MkObjectC::getOBJN__null_allow ( const MkObjectC * clsHdl)
inlinestatic

(const) return LibMsgqueObject from current MkObjectC pointer

Definition at line 132 of file MkObjectC_cc.hh.

132 {
133 return clsHdl ? reinterpret_cast<MK_OBJN>(clsHdl->hdl) : NULL;
134 };

◆ MkObjectC() [1/2]

ccmkkernel::MkObjectC::MkObjectC ( )
inlineprotected

Definition at line 185 of file MkObjectC_cc.hh.

185 {
186 atomInit(NULL);
187 };
void atomInit(MK_OBJ obj)

◆ MkObjectC() [2/2]

ccmkkernel::MkObjectC::MkObjectC ( MK_OBJ obj)
inlineprotected

Definition at line 188 of file MkObjectC_cc.hh.

188 {
189 atomInit(obj);
190 }

◆ MkObjectC_ObjNew()

static MkObjectC * ccmkkernel::MkObjectC::MkObjectC_ObjNew ( MK_RT_ARGS MK_OBJ hdl)
inlinestatic

return MkObjectC from LibMsgqueObject

Definition at line 84 of file MkObjectC_cc.hh.

84 {
86 }
static thread_local MkObjectC MK_NULL_REF
static MK_PTR atomObjNew(MK_RT_ARGS MK_OBJ obj)
#define MkObjectC_X2obj(x)
#define MK_RT_CALL
+ Here is the caller graph for this function:

◆ ToNativeNameOfClass()

MK_STRN ccmkkernel::MkObjectC::ToNativeNameOfClass ( ) const
inline

Definition at line 241 of file MkObjectC_cc.hh.

241 {
242 const char * str = typeid(*this).name();
243 return str ? abi::__cxa_demangle(str,0,0,NULL) : "*unknown*";
244 }

◆ ~MkObjectC()

virtual ccmkkernel::MkObjectC::~MkObjectC ( )
inlinevirtual

Definition at line 226 of file MkObjectC_cc.hh.

226 {
227 if (hdl) {
229 // important: every item deleted with destructor… the "self" object
230 // is already destroyed… set NULL in MkObjectS
232 }
233 }
#define MkRtSetup_NULL

Variable Documentation

◆ hdl

MK_OBJ ccmkkernel::MkObjectC::hdl = NULL
protected

Definition at line 166 of file MkObjectC_cc.hh.

◆ MK_NULL_REF

thread_local MkObjectC ccmkkernel::MkObjectC::MK_NULL_REF = {(MK_OBJ)0}
static

Definition at line 41 of file MkObjectC_cc.hh.

◆ mkrt

MK_RT ccmkkernel::MkObjectC::mkrt = NULL
protected

Definition at line 168 of file MkObjectC_cc.hh.