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 } // namespace XERCES_CPP_NAMESPACE
18 
19 namespace l1t {
20 
21  class TriggerSystem;
22 
24  public:
25  const XMLCh* kTagHw;
26  const XMLCh* kTagAlgo;
27  const XMLCh* kTagRunSettings;
28  const XMLCh* kTagDb;
29  const XMLCh* kTagKey;
30  const XMLCh* kTagLoad;
31  const XMLCh* kTagContext;
32  const XMLCh* kTagParam;
33  const XMLCh* kTagMask;
34  const XMLCh* kTagDisable;
35  const XMLCh* kTagExclBoards;
36  const XMLCh* kTagExclude;
37  const XMLCh* kTagColumns;
38  const XMLCh* kTagTypes;
39  const XMLCh* kTagRow;
40  const XMLCh* kTagProcessor;
41  const XMLCh* kTagRole;
42  const XMLCh* kTagCrate;
43  const XMLCh* kTagSlot;
44  const XMLCh* kTagDaqTtc;
45  const XMLCh* kAttrId;
46  const XMLCh* kAttrType;
47  const XMLCh* kAttrDelim;
48  const XMLCh* kAttrModule;
50 
52  XmlConfigParser(xercesc::DOMDocument* doc);
54  void readDOMFromString(const std::string& str, xercesc::DOMDocument*& doc);
55  void readDOMFromString(const std::string& str);
56  void readDOMFromFile(const std::string& fName, xercesc::DOMDocument*& doc);
57  void readDOMFromFile(const std::string& fName);
58  void readRootElement(TriggerSystem& aTriggerSystem, const std::string& sysId = "");
59  void readElement(const xercesc::DOMElement* element, TriggerSystem& aTriggerSystem, const std::string& sysId = "");
60  void readHwDescription(const xercesc::DOMElement* element,
61  TriggerSystem& aTriggerSystem,
62  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  xercesc::XercesDOMParser* parser_;
70  xercesc::DOMDocument* doc_;
71 
72  void appendNodesFromSubDoc(xercesc::DOMNode* parentNode, xercesc::DOMDocument* subDoc);
74  char* pruneString(char*& str);
75  };
76 
77 } // namespace l1t
78 #endif
l1t::XmlConfigParser::doc_
xercesc::DOMDocument * doc_
Definition: XmlConfigParser.h:70
l1t::XmlConfigParser::kTagColumns
const XMLCh * kTagColumns
Definition: XmlConfigParser.h:37
common_cff.doc
doc
Definition: common_cff.py:54
l1t::XmlConfigParser::kTagDb
const XMLCh * kTagDb
Definition: XmlConfigParser.h:28
l1t::XmlConfigParser::readRootElement
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
Definition: XmlConfigParser.cc:189
l1t::XmlConfigParser::appendNodesFromSubDoc
void appendNodesFromSubDoc(xercesc::DOMNode *parentNode, xercesc::DOMDocument *subDoc)
Definition: XmlConfigParser.cc:560
l1t::XmlConfigParser::kTagDaqTtc
const XMLCh * kTagDaqTtc
Definition: XmlConfigParser.h:44
l1t::XmlConfigParser::kTagExclude
const XMLCh * kTagExclude
Definition: XmlConfigParser.h:36
l1t::TriggerSystem
Definition: TriggerSystem.h:14
MainPageGenerator.fName
fName
Definition: MainPageGenerator.py:301
l1t::XmlConfigParser::getKeyElement
xercesc::DOMElement * getKeyElement(const std::string &key)
Definition: XmlConfigParser.cc:518
l1t::XmlConfigParser::kTagRunSettings
const XMLCh * kTagRunSettings
Definition: XmlConfigParser.h:27
l1t::XmlConfigParser::readContexts
void readContexts(const std::string &key, const std::string &sysId, TriggerSystem &aTriggerSystem)
Definition: XmlConfigParser.cc:502
l1t::XmlConfigParser::kTagHw
const XMLCh * kTagHw
Definition: XmlConfigParser.h:25
l1t::XmlConfigParser::kTagSlot
const XMLCh * kTagSlot
Definition: XmlConfigParser.h:43
l1t::XmlConfigParser::kTagDisable
const XMLCh * kTagDisable
Definition: XmlConfigParser.h:34
l1t::XmlConfigParser::kAttrModule
const XMLCh * kAttrModule
Definition: XmlConfigParser.h:48
str
#define str(s)
Definition: TestProcessor.cc:48
XERCES_CPP_NAMESPACE
Definition: XmlConfigParser.h:12
l1t::XmlConfigParser::readHwDescription
void readHwDescription(const xercesc::DOMElement *element, TriggerSystem &aTriggerSystem, const std::string &sysId="")
Definition: XmlConfigParser.cc:211
l1t::XmlConfigParser::kTagCrate
const XMLCh * kTagCrate
Definition: XmlConfigParser.h:42
l1t::XmlConfigParser::kTagTypes
const XMLCh * kTagTypes
Definition: XmlConfigParser.h:38
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::XmlConfigParser
Definition: XmlConfigParser.h:23
l1t::XmlConfigParser::kTagExclBoards
const XMLCh * kTagExclBoards
Definition: XmlConfigParser.h:35
l1t::XmlConfigParser::kTagAlgo
const XMLCh * kTagAlgo
Definition: XmlConfigParser.h:26
l1t::XmlConfigParser::readElement
void readElement(const xercesc::DOMElement *element, TriggerSystem &aTriggerSystem, const std::string &sysId="")
Definition: XmlConfigParser.cc:200
l1t::XmlConfigParser::readDOMFromFile
void readDOMFromFile(const std::string &fName, xercesc::DOMDocument *&doc)
l1t
delete x;
Definition: CaloConfig.h:22
l1t::XmlConfigParser::parser_
xercesc::XercesDOMParser * parser_
Definition: XmlConfigParser.h:69
l1t::XmlConfigParser::kTagMask
const XMLCh * kTagMask
Definition: XmlConfigParser.h:33
l1t::XmlConfigParser::kTypeTable
const std::string kTypeTable
Definition: XmlConfigParser.h:49
l1t::XmlConfigParser::kTagRow
const XMLCh * kTagRow
Definition: XmlConfigParser.h:39
l1t::XmlConfigParser::kAttrId
const XMLCh * kAttrId
Definition: XmlConfigParser.h:45
l1t::XmlConfigParser::pruneString
void pruneString(std::string &str)
Definition: XmlConfigParser.cc:594
l1t::XmlConfigParser::kTagContext
const XMLCh * kTagContext
Definition: XmlConfigParser.h:31
l1t::XmlConfigParser::readContext
void readContext(const xercesc::DOMElement *element, const std::string &sysId, TriggerSystem &aTriggerSystem)
Definition: XmlConfigParser.cc:376
l1t::XmlConfigParser::kAttrDelim
const XMLCh * kAttrDelim
Definition: XmlConfigParser.h:47
l1t::XmlConfigParser::kTagRole
const XMLCh * kTagRole
Definition: XmlConfigParser.h:41
l1t::XmlConfigParser::XmlConfigParser
XmlConfigParser()
Definition: XmlConfigParser.cc:30
l1t::XmlConfigParser::kTagProcessor
const XMLCh * kTagProcessor
Definition: XmlConfigParser.h:40
l1t::XmlConfigParser::kAttrType
const XMLCh * kAttrType
Definition: XmlConfigParser.h:46
l1t::XmlConfigParser::kTagLoad
const XMLCh * kTagLoad
Definition: XmlConfigParser.h:30
l1t::XmlConfigParser::kTagKey
const XMLCh * kTagKey
Definition: XmlConfigParser.h:29
l1t::XmlConfigParser::readDOMFromString
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
l1t::XmlConfigParser::buildGlobalDoc
void buildGlobalDoc(const std::string &key, const std::string &topPath="")
Definition: XmlConfigParser.cc:533
l1t::XmlConfigParser::~XmlConfigParser
~XmlConfigParser()
Definition: XmlConfigParser.cc:148
crabWrapper.key
key
Definition: crabWrapper.py:19
l1t::XmlConfigParser::kTagParam
const XMLCh * kTagParam
Definition: XmlConfigParser.h:32