CMS 3D CMS Logo

XmlConfigParser.h
Go to the documentation of this file.
1 #ifndef L1Trigger_L1TCommon_l1t_XmlConfigParser_h
2 #define L1Trigger_L1TCommon_l1t_XmlConfigParser_h
3 
4 #include <string>
5 #include <vector>
6 
7 #include "xercesc/util/XercesDefs.hpp"
8 #include "xercesc/parsers/XercesDOMParser.hpp"
9 #include "xercesc/dom/DOM.hpp"
10 #include "xercesc/framework/MemBufInputSource.hpp"
11 
13 
14 class DOMNode;
15 class XercesDOMParser;
16 
17 }
18 
19 namespace l1t {
20 
21 class TriggerSystem;
22 
24 
25  public:
26 
27  const XMLCh* kTagHw;
28  const XMLCh* kTagAlgo;
29  const XMLCh* kTagRunSettings;
30  const XMLCh* kTagDb;
31  const XMLCh* kTagKey;
32  const XMLCh* kTagLoad;
33  const XMLCh* kTagContext;
34  const XMLCh* kTagParam;
35  const XMLCh* kTagMask;
36  const XMLCh* kTagDisable;
37  const XMLCh* kTagExclBoards;
38  const XMLCh* kTagExclude;
39  const XMLCh* kTagColumns;
40  const XMLCh* kTagTypes;
41  const XMLCh* kTagRow;
42  const XMLCh* kTagProcessor;
43  const XMLCh* kTagRole;
44  const XMLCh* kTagCrate;
45  const XMLCh* kTagSlot;
46  const XMLCh* kTagDaqTtc;
47  const XMLCh* kAttrId;
48  const XMLCh* kAttrType;
49  const XMLCh* kAttrDelim;
50  const XMLCh* kAttrModule;
52 
54  XmlConfigParser(xercesc::DOMDocument* doc);
55  ~XmlConfigParser();
56  void readDOMFromString(const std::string& str, xercesc::DOMDocument*& doc);
57  void readDOMFromString(const std::string& str);
58  void readDOMFromFile(const std::string& fName, xercesc::DOMDocument*& doc);
59  void readDOMFromFile(const std::string& fName);
60  void readRootElement(TriggerSystem& aTriggerSystem, const std::string& sysId = "");
61  void readElement(const xercesc::DOMElement* element, TriggerSystem& aTriggerSystem, const std::string& sysId = "");
62  void readHwDescription(const xercesc::DOMElement* element, TriggerSystem& aTriggerSystem, const std::string& sysId = "");
63  void readContext(const xercesc::DOMElement* element, const std::string& sysId, TriggerSystem& aTriggerSystem);
64  void readContexts(const std::string& key, const std::string& sysId, TriggerSystem& aTriggerSystem);
65  xercesc::DOMElement* getKeyElement(const std::string& key);
66  void buildGlobalDoc(const std::string& key, const std::string& topPath = "");
67 
68  private:
69 
70  xercesc::XercesDOMParser* parser_;
71  xercesc::DOMDocument* doc_;
72 
73  void appendNodesFromSubDoc(xercesc::DOMNode* parentNode, xercesc::DOMDocument* subDoc);
74  void pruneString(std::string& str);
75  char* pruneString(char* &str);
76 };
77 
78 }
79 #endif
80 
const XMLCh * kTagMask
const std::string kTypeTable
const XMLCh * kTagAlgo
const XMLCh * kAttrDelim
const XMLCh * kTagCrate
const XMLCh * kTagRow
const XMLCh * kTagExclBoards
const XMLCh * kTagRole
const XMLCh * kTagProcessor
delete x;
Definition: CaloConfig.h:22
const XMLCh * kTagLoad
const XMLCh * kAttrId
const XMLCh * kAttrType
const XMLCh * kTagContext
const XMLCh * kTagParam
const XMLCh * kTagColumns
const XMLCh * kTagKey
xercesc::DOMDocument * doc_
const XMLCh * kTagExclude
const XMLCh * kTagDb
const XMLCh * kTagDisable
const XMLCh * kTagDaqTtc
const XMLCh * kAttrModule
#define str(s)
const XMLCh * kTagHw
xercesc::XercesDOMParser * parser_
const XMLCh * kTagTypes
const XMLCh * kTagSlot
const XMLCh * kTagRunSettings