theConfig 10.0
Loading...
Searching...
No Matches
LcConfigC_cc.hh
Go to the documentation of this file.
1
9/* LABEL-INIT */
10
11#pragma once
12
13#include <list>
14
15// [LcSettingDeleteIF]
16namespace cclcconfig {
19 virtual void LcSettingDelete (MK_I32) = 0;
20 };
21}
22// [LcSettingDeleteIF]
23
24// [LcSettingDeleteSCB]
25namespace cclcconfig {
27 typedef void (*LcSettingDeleteSCB) (MK_I32 hdl);
28}
29// [LcSettingDeleteSCB]
30
31// [LcConfigIncludeIF]
32namespace cclcconfig {
35 virtual void LcConfigInclude (std::string incDir, std::string path, MkBufferListC &ret) = 0;
36 };
37}
38// [LcConfigIncludeIF]
39
40// [LcConfigIncludeSCB]
41namespace cclcconfig {
43 typedef void (*LcConfigIncludeSCB) (
44 std::string incDir, std::string path, MkBufferListC &ret
45 );
46}
47// [LcConfigIncludeSCB]
48
49namespace cclcconfig {
50
53 typedef struct {
57
60 class LcConfigC : public MkObjectC {
61
62 friend class LcConfig;
65
66 static inline MK_PTR LcConfigC_selfCreateTLS (MK_OBJ obj);
67
68/* LABEL-START */
69
72
73 public:
74 static thread_local LcConfigC MK_NULL_REF;
75
76 private:
77
78 static LcConfigC* LcConfigC_GetSelf (LC_CFG hdl) {
79 return (hdl != NULL ? static_cast<LcConfigC*>((*LcConfigC_X2obj(hdl)).self) : &MK_NULL_REF);
80 }
81
82 #ifdef LcConfigC_selfCreate_overload
83 static MK_PTR LcConfigC_selfCreate (MK_RT_ARGS MK_OBJ obj, MK_PTR const env);
84 #else
85 static MK_PTR LcConfigC_selfCreate (MK_RT_ARGS MK_OBJ obj, MK_PTR const env) {
86 return new LcConfigC(obj);
87 }
88 #endif
89
90 static void LcConfigC_selfDelete (MK_RT_ARGS MK_PTR self, MK_PTR env) {
91 delete static_cast<LcConfigC*>(self);
92 }
93
94 static void LcConfigC_selfUnlink (MK_RT_ARGS MK_PTR self, MK_PTR env) {
95 LcConfigC* selfO = static_cast<LcConfigC*>(self);
96 selfO->atomUnlink();
97 }
98
99 void LcConfigC_Init (LC_CFG hdl) { atomInit(LcConfigC_X2obj(hdl)); };
100
101
102 static LcConfigC* LcConfigC_ObjCreate (MK_RT_ARGS LC_CFG hdl) {
104 }
105
106#ifndef META_IS_MkObjectC
107 LcConfigC (MK_OBJ obj) : MkObjectC(obj) {};
108#endif
109
110 public:
111
112#ifndef META_IS_MkObjectC
114#endif
115
120
122 LC_CFG getCFG() const {
123 LC_CFG ret = reinterpret_cast<LC_CFG>(hdl);
124 if (unlikely(ret == NULL)) InstHdlIsNullError();
125 return ret;
126 };
127
130 return reinterpret_cast<LC_CFG>(hdl);
131 };
132
134 LC_CFGN getCFGN() const {
135 LC_CFGN ret = reinterpret_cast<LC_CFGN>(hdl);
136 if (unlikely(ret == NULL)) InstHdlIsNullError();
137 return ret;
138 };
139
142 return reinterpret_cast<LC_CFGN>(hdl);
143 };
144
146 static LC_CFG getCFG(LcConfigC* clsHdl) {
147 LC_CFG ret = clsHdl ? reinterpret_cast<LC_CFG>(clsHdl->hdl) : NULL;
148 if (unlikely(ret == NULL)) ClassHdlIsNullError(LcConfigC);
149 return ret;
150 };
151
154 return clsHdl ? reinterpret_cast<LC_CFG>(clsHdl->hdl) : NULL;
155 };
156
158 static LC_CFGN getCFGN(const LcConfigC* clsHdl) {
159 LC_CFGN ret = clsHdl ? reinterpret_cast<LC_CFGN>(clsHdl->hdl) : NULL;
160 if (unlikely(ret == NULL)) ClassHdlIsNullError(LcConfigC);
161 return ret;
162 };
163
165 static LC_CFGN getCFGN__null_allow(const LcConfigC* clsHdl) {
166 return clsHdl ? reinterpret_cast<LC_CFGN>(clsHdl->hdl) : NULL;
167 };
168
170 static LC_CFG getCFG(const LcConfigC& clsHdl) {
171 return clsHdl.getCFG();
172 };
173
175 static LC_CFG getCFG__null_allow(const LcConfigC& clsHdl) {
176 return clsHdl.getCFG__null_allow();
177 };
178
180 static LC_CFGN getCFGN(const LcConfigC& clsHdl) {
181 return clsHdl.getCFGN();
182 };
183
185 static LC_CFGN getCFGN__null_allow(const LcConfigC& clsHdl) {
186 return clsHdl.getCFGN__null_allow();
187 };
188
190 bool Check() const {
191 return (hdl && LcCfgCheck(hdl));
192 };
193
194/* LABEL-END */
195
196 public:
197
198/* NO copy constructor
199 inline LcConfigC (const LcConfigC* hdl);
200 inline LcConfigC (const LcConfigC& ref);
201 inline LcConfigC& operator= (const LcConfigC& buf);
202 inline LcConfigC& operator= (const LcConfigC* buf);
203*/
204
205 // BEGIN-LcConfigC - created by 'cc_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
206
210
211 public:
212
213 // doc-key: LcConfigC,LcConfigC-Class-Export,sc_,public
214
216 static LcConfigC* HandleResolve (MK_HDL netHdl);
217
218 // doc-key: LcConfigC,LcConfigC-Class-Export,om_,public
219
220 // skip class-overload: MK_HDL HandleGet ()
221
223 // LcConfigC_Class_CC_API
224
228
229 public:
230
231 // doc-key: LcConfigC,LcConfigC-Class-Introspection,oc_,public
232
234 LcConfigC* Next ();
235
237 LcConfigC* Prev ();
238
239 // doc-key: LcConfigC,LcConfigC-Class-Introspection,sc_,public
240
242 static LcConfigC* Instances ();
243
245 // LcConfigC_Class_CC_API
246
250
251 public:
252
253 // doc-key: LcConfigC,LcConfigC-Class-Misc,sc_,public
254
256 static LcConfigC* GetNull ();
257
259 // LcConfigC_Class_CC_API
260
264
265 public:
266
267 // doc-key: LcConfigC,LcConfigC-Error,om_,public
268
270 LcErrorTypeE ErrorType () const;
271
273 // LcConfigC_Error_CC_API
274
278
279 public:
280
281 // doc-key: LcConfigC,LcConfigC-Get,om_,public
282
285
287 MK_I16 GetFloatPrecision () const;
288
290 MK_STRN GetIncludeDir () const;
291
293 MK_BOOL GetOption (LcConfigOptionsEF option) const;
294
297
299 MK_I16 GetTabWidth () const;
300
302 // LcConfigC_Get_CC_API
303
307
308 public:
309
310 // doc-key: LcConfigC,LcConfigC-Lookup,oc_,public
311
313 LcSettingC* Lookup (MK_STRN path) const;
314
316 LcSettingC* Lookup (const std::string& path) const;
317
318 // doc-key: LcConfigC,LcConfigC-Lookup,omo,public
319
321 MK_BOOL LookupBool (MK_STRN path) const;
322
324 MK_BOOL LookupBool (const std::string& path) const;
325
327 MK_DBL LookupFloat (MK_STRN path) const;
328
330 MK_DBL LookupFloat (const std::string& path) const;
331
333 MK_I32 LookupInt (MK_STRN path) const;
334
336 MK_I32 LookupInt (const std::string& path) const;
337
339 MK_I64 LookupInt64 (MK_STRN path) const;
340
342 MK_I64 LookupInt64 (const std::string& path) const;
343
345 MK_STRN LookupString (MK_STRN path) const;
346
348 MK_STRN LookupString (const std::string& path) const;
349
351 // LcConfigC_Lookup_CC_API
352
356
357 public:
358
359 // doc-key: LcConfigC,LcConfigC-Misc,oc_,public
360
362 LcSettingC* RootSetting () const;
363
364 // doc-key: LcConfigC,LcConfigC-Misc,om_,public
365
367 void Clear ();
368
370 void Log (const MkObjectC* fmtobj = NULL, MK_DBG debug = 0, MK_STRN callfunc = __builtin_FUNCTION(), MK_I32 lvl = 0) const;
371
373 void Log (const MkObjectC& fmtobj, MK_DBG debug = 0, MK_STRN callfunc = __builtin_FUNCTION(), MK_I32 lvl = 0) const;
374
376 void ReadFile (MK_STRN filename);
377
379 void ReadFile (const std::string& filename);
380
382 void ReadString (MK_STRN str);
383
385 void ReadString (const std::string& str);
386
388 void WriteFile (MK_STRN filename);
389
391 void WriteFile (const std::string& filename);
392
393 // doc-key: LcConfigC,LcConfigC-Misc,omo,public
394
396 MK_STRN WriteString () const;
397
399 // LcConfigC_Misc_CC_API
400
404
405 public:
406
407 // doc-key: LcConfigC,LcConfigC-Set,om_,public
408
410 void SetDefaultFormat (LcConfigFormatE format);
411
413 void SetFloatPrecision (MK_I16 digits);
414
416 void SetIncludeDir (MK_STRN include_dir);
417
419 void SetIncludeDir (const std::string& include_dir);
420
422 void SetIncludeFunc (LcConfigIncludeIF* fConfigIncludeData = NULL);
423
425 void SetIncludeFunc (LcConfigIncludeSCB fConfigIncludeData = NULL);
426
428 void SetOption (LcConfigOptionsEF option, MK_BOOL flag);
429
431 void SetOptions (LcConfigOptionsEF options);
432
434 void SetSettingDeleteFunc (LcSettingDeleteIF* fSettingDeleteData = NULL);
435
437 void SetSettingDeleteFunc (LcSettingDeleteSCB fSettingDeleteData = NULL);
438
440 void SetTabWidth (MK_I16 width);
441
443 // LcConfigC_Set_CC_API
444
448
449 private:
450
451 // doc-key: LcConfigC,LcConfigC-TOR,sCc,private
452
454 static MK_OBJ CTOR ();
455
456 public:
457
458 // doc-key: LcConfigC,LcConfigC-TOR,sCc,public
459
461 static LcConfigC* Create ();
462
464 LcConfigC () : MkObjectC(CTOR()) {};
465
467 // LcConfigC_TOR_CC_API
468
469 // END-LcConfigC - created by 'cc_MqS.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
470
472
473 }; // class LcConfigC
474} // namespace cclcconfig
Struct to represent the data from the LcConfigC … → C-API: liblcconfig::LcConfigS
LcConfig PACKAGE - the package is the toplevel structure of the cclcconfig …
Struct to represent the data from the LcSettingC … → C-API: liblcconfig::LcSettingS
static LC_CFGN getCFGN(const LcConfigC &clsHdl)
(const) return LibMsgqueObject from current LcConfigC reference
bool Check() const
check if pointer is still valid
static LC_CFGN getCFGN(const LcConfigC *clsHdl)
(const) return LibMsgqueObject from current LcConfigC pointer
LC_CFGN getCFGN() const
(const) return the LibMsgqueObject from current LcConfigC instance
static thread_local LcConfigC MK_NULL_REF
LC_CFG getCFG() const
return the LibMsgqueObject from current LcConfigC instance
static LC_CFGN getCFGN__null_allow(const LcConfigC &clsHdl)
(const) return LibMsgqueObject from current LcConfigC reference
static LC_CFG getCFG__null_allow(const LcConfigC &clsHdl)
return LibMsgqueObject from current LcConfigC reference
static LC_CFGN getCFGN__null_allow(const LcConfigC *clsHdl)
(const) return LibMsgqueObject from current LcConfigC pointer
static LC_CFG getCFG(const LcConfigC &clsHdl)
return LibMsgqueObject from current LcConfigC reference
static LcConfigC * LcConfigC_ObjNew(MK_RT_ARGS LC_CFG hdl)
return LcConfigC from LibMsgqueObject
static LC_CFG getCFG(LcConfigC *clsHdl)
return LibMsgqueObject from current LcConfigC pointer
static LC_CFG getCFG__null_allow(LcConfigC *clsHdl)
return LibMsgqueObject from current LcConfigC pointer
LC_CFG getCFG__null_allow() const
return the LibMsgqueObject from current LcConfigC instance
LC_CFGN getCFGN__null_allow() const
(const) return the LibMsgqueObject from current LcConfigC instance
static LcConfigC * Instances()
C++: [static] LcConfigC* LcConfigC::Instances() → C-API get head-instance from linked-list of Lc...
LcConfigC * Prev()
C++: LcConfigC* cfg.Prev() → C-API get previous instance from linked-list of LcConfigS type
static LcConfigC * GetNull()
C++: [static] LcConfigC* LcConfigC::GetNull() → C-API Null-Slot - return a LcConfigC typed NULL ...
LcConfigC * Next()
C++: LcConfigC* cfg.Next() → C-API get next instance from linked-list of LcConfigS type
static LcConfigC * HandleResolve(MK_HDL netHdl)
C++: [static] LcConfigC* LcConfigC::HandleResolve(MK_HDL netHdl) → C-API Handle-Resolve-Slot - r...
struct LcConfigS * LC_CFG
class-shortcut for struct LcConfigS *, all shortcut using the XX_YYY syntax (only for public API) …
#define LcConfigC_X2obj(x)
static bool LcCfgCheck(MK_MNGN mng)
check LcConfigS -> libmkkernel::MkObjectS::signature …
LcErrorTypeE ErrorType() const
C++: LcErrorTypeE config.ErrorType() → C-API This function, which is implemented as a macro,...
LcConfigOptionsEF GetOptions() const
C++: LcConfigOptionsEF config.GetOptions() → C-API These functions get and set the options for ...
MK_I16 GetTabWidth() const
C++: MK_I16 config.GetTabWidth() → C-API These functions, which are implemented as macros,...
MK_STRN GetIncludeDir() const
C++: MK_STRN config.GetIncludeDir() → C-API ConfigSetIncludeDir specifies the include directory...
MK_I16 GetFloatPrecision() const
C++: MK_I16 config.GetFloatPrecision() → C-API Since v1.6 These functions get and set the numbe...
MK_BOOL GetOption(LcConfigOptionsEF option) const
C++: MK_BOOL config.GetOption(LcConfigOptionsEF option) → C-API Since v1.7 These functions get ...
LcConfigFormatE GetDefaultFormat() const
C++: LcConfigFormatE config.GetDefaultFormat() → C-API These functions, which are implemented a...
MK_STRN LookupString(MK_STRN path) const
C++: MK_STRN config.LookupString(MK_STRN path) → C-API These functions look up the value of the...
LcSettingC * Lookup(MK_STRN path) const
C++: LcSettingC* config.Lookup(MK_STRN path) → C-API This function locates the setting in the c...
MK_BOOL LookupBool(MK_STRN path) const
C++: MK_BOOL config.LookupBool(MK_STRN path) → C-API These functions look up the value of the s...
MK_I32 LookupInt(MK_STRN path) const
C++: MK_I32 config.LookupInt(MK_STRN path) → C-API These functions look up the value of the set...
MK_I64 LookupInt64(MK_STRN path) const
C++: MK_I64 config.LookupInt64(MK_STRN path) → C-API These functions look up the value of the s...
MK_DBL LookupFloat(MK_STRN path) const
C++: MK_DBL config.LookupFloat(MK_STRN path) → C-API These functions look up the value of the s...
void ReadString(MK_STRN str)
C++: config.ReadString(MK_STRN str) → C-API This function reads and parses a configuration from...
MK_STRN WriteString() const
C++: MK_STRN cfg.WriteString() → C-API read the entire configuration cfg into the string val_ou...
void ReadFile(MK_STRN filename)
C++: config.ReadFile(MK_STRN filename) → C-API This function reads and parses a configuration f...
LcSettingC * RootSetting() const
C++: LcSettingC* config.RootSetting() → C-API This function, which is implemented as a macro,...
void Log(const MkObjectC *fmtobj=NULL, MK_DBG debug=0, MK_STRN callfunc=__builtin_FUNCTION(), MK_I32 lvl=0) const
C++: cfg.Log(const MkObjectC* fmtobj = NULL, MK_DBG debug = 0, MK_STRN callfunc = __builtin_FUNCTION...
void WriteFile(MK_STRN filename)
C++: config.WriteFile(MK_STRN filename) → C-API This function writes the configuration config t...
void Clear()
C++: config.Clear() → C-API Since v1.7 This function clears the configuration config …
void SetIncludeDir(MK_STRN include_dir)
C++: config.SetIncludeDir(MK_STRN include_dir) → C-API ConfigSetIncludeDir specifies the includ...
void SetIncludeFunc(LcConfigIncludeIF *fConfigIncludeData=NULL)
C++: cfg.SetIncludeFunc(LcConfigIncludeSCB LcConfigIncludeIF* fConfigIncludeData = NULL) → C-API ...
void SetSettingDeleteFunc(LcSettingDeleteIF *fSettingDeleteData=NULL)
C++: cfg.SetSettingDeleteFunc(LcSettingDeleteSCB LcSettingDeleteIF* fSettingDeleteData = NULL) → C-...
void SetDefaultFormat(LcConfigFormatE format)
C++: config.SetDefaultFormat(LcConfigFormatE format) → C-API These functions,...
void SetOptions(LcConfigOptionsEF options)
C++: config.SetOptions(LcConfigOptionsEF options) → C-API These functions get and set the optio...
void SetTabWidth(MK_I16 width)
C++: config.SetTabWidth(MK_I16 width) → C-API These functions, which are implemented as macros,...
void SetOption(LcConfigOptionsEF option, MK_BOOL flag)
C++: config.SetOption(LcConfigOptionsEF option, MK_BOOL flag) → C-API Since v1....
void SetFloatPrecision(MK_I16 digits)
C++: config.SetFloatPrecision(MK_I16 digits) → C-API Since v1.6 These functions get and set the...
LcConfigC()
C++: [constructor,static] LcConfigC* LcConfigC::Create() → C-API create a LcConfigC instance …
static LcConfigC * Create()
C++: [constructor,static] LcConfigC* LcConfigC::Create() → C-API create a LcConfigC instance …
LcConfigOptionsEF
define the configuration-option of a LcConfigC …
Definition LcEnum_lc.h:134
LcConfigFormatE
set the format of a LcSettingC …
Definition LcEnum_lc.h:30
LcErrorTypeE
error types
Definition LcEnum_lc.h:228
#define unlikely(x)
double MK_DBL
signed long long MK_I64
int32_t MK_HDL
int32_t MK_NUM
signed short int MK_I16
signed int MK_I32
MK_PTRB * MK_PTR
const MK_STRB * MK_STRN
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
#define MK_RT_CALL
#define MK_RT_ARGS
namespace for the CcLcConfig "C++"-API
Definition LcCall_cc.cc:21
void(* LcSettingDeleteSCB)(MK_I32 hdl)
static callback fired just before deleting a LcSettingC …
void(* LcConfigIncludeSCB)(std::string incDir, std::string path, MkBufferListC &ret)
static callback fired if a @include "FILE-PATTERN" is found in the config-file …
Struct to represent the data from the LcConfigC … → C-API: liblcconfig::LcConfigS
infrastructur to use the cclcconfig specific callback …
Definition LcCall_cc.hh:18
interface fired if a @include "FILE-PATTERN" is found in the config-file …
virtual void LcConfigInclude(std::string incDir, std::string path, MkBufferListC &ret)=0
infrastructur to use the cclcconfig specific callback …
Definition LcCall_cc.hh:55
interface fired just before deleting a LcSettingC …
virtual void LcSettingDelete(MK_I32)=0
Struct to represent the data from the LcConfigC …