DABC (Data Acquisition Backbone Core)  2.9.9
ConfigIO.h
Go to the documentation of this file.
1 // $Id: ConfigIO.h 4468 2020-04-15 12:47:38Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #ifndef DABC_ConfigIO
17 #define DABC_ConfigIO
18 
19 #ifndef DABC_XmlEngine
20 #include "dabc/XmlEngine.h"
21 #endif
22 
23 namespace dabc {
24 
25  class Object;
26  class Configuration;
27 
28  class RecordField;
29  class RecordFieldsMap;
30 
38  class ConfigIO {
39 
40  // TODO: later ConfigIO should be non-transient reference on configuration class
41 
42  protected:
44 
47  bool fCurrStrict;
48  int fCgfId;
49 
50  XMLNodePointer_t FindSubItem(XMLNodePointer_t node, const char* name);
51 
52  static Object* GetObjParent(Object* obj, int lvl);
53 
54  std::string ResolveEnv(const char* value);
55 
56  public:
57  ConfigIO(Configuration* cfg, int id = -1);
58 
59  ConfigIO(const ConfigIO& src);
60 
61  virtual ~ConfigIO() {}
62 
63  bool FindItem(const char* name);
64 
66  bool CheckAttr(const char* name, const char* value);
67 
68  bool ReadRecordField(Object* obj, const std::string &name, RecordField* field, RecordFieldsMap* fieldsmap);
69  };
70 
71 }
72 
73 #endif
Interface class between xml configuration and dabc objects.
Definition: ConfigIO.h:38
int fCgfId
special ID which can be used ${}# formula
Definition: ConfigIO.h:48
bool FindItem(const char *name)
Definition: ConfigIO.cxx:42
Configuration * fCfg
pointer on configuration object
Definition: ConfigIO.h:43
std::string ResolveEnv(const char *value)
Definition: ConfigIO.cxx:123
XMLNodePointer_t fCurrItem
currently found item
Definition: ConfigIO.h:45
virtual ~ConfigIO()
Definition: ConfigIO.h:61
bool fCurrStrict
must have strict syntax match
Definition: ConfigIO.h:47
bool ReadRecordField(Object *obj, const std::string &name, RecordField *field, RecordFieldsMap *fieldsmap)
Definition: ConfigIO.cxx:132
XMLNodePointer_t FindSubItem(XMLNodePointer_t node, const char *name)
Definition: ConfigIO.cxx:112
XMLNodePointer_t fCurrChld
selected child in current item
Definition: ConfigIO.h:46
ConfigIO(Configuration *cfg, int id=-1)
Definition: ConfigIO.cxx:24
bool CheckAttr(const char *name, const char *value)
Check if item, found by FindItem routine, has attribute with specified value.
Definition: ConfigIO.cxx:63
static Object * GetObjParent(Object *obj, int lvl)
Definition: ConfigIO.cxx:99
Full-functional class to reading configuration from xml files.
Definition: Configuration.h:34
Base class for most of the DABC classes.
Definition: Object.h:116
Event manipulation API.
Definition: api.h:23
void * XMLNodePointer_t
Definition: XmlEngine.h:25