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
void pruneString(std::string &str)
const XMLCh * kTagMask
const std::string kTypeTable
const XMLCh * kTagAlgo
const XMLCh * kAttrDelim
void readDOMFromFile(const std::string &fName, xercesc::DOMDocument *&doc)
const XMLCh * kTagCrate
const XMLCh * kTagRow
const XMLCh * kTagExclBoards
const XMLCh * kTagRole
void readElement(const xercesc::DOMElement *element, TriggerSystem &aTriggerSystem, const std::string &sysId="")
const XMLCh * kTagProcessor
delete x;
Definition: CaloConfig.h:22
const XMLCh * kTagLoad
const XMLCh * kAttrId
const XMLCh * kAttrType
const XMLCh * kTagContext
const XMLCh * kTagParam
void readContext(const xercesc::DOMElement *element, const std::string &sysId, TriggerSystem &aTriggerSystem)
const XMLCh * kTagColumns
const XMLCh * kTagKey
void readDOMFromString(const std::string &str, xercesc::DOMDocument *&doc)
void buildGlobalDoc(const std::string &key, const std::string &topPath="")
void appendNodesFromSubDoc(xercesc::DOMNode *parentNode, xercesc::DOMDocument *subDoc)
key
prepare the HTCondor submission files and eventually submit them
xercesc::DOMDocument * doc_
xercesc::DOMElement * getKeyElement(const std::string &key)
const XMLCh * kTagExclude
const XMLCh * kTagDb
const XMLCh * kTagDisable
void readRootElement(TriggerSystem &aTriggerSystem, const std::string &sysId="")
void readContexts(const std::string &key, const std::string &sysId, TriggerSystem &aTriggerSystem)
const XMLCh * kTagDaqTtc
const XMLCh * kAttrModule
void readHwDescription(const xercesc::DOMElement *element, TriggerSystem &aTriggerSystem, const std::string &sysId="")
#define str(s)
const XMLCh * kTagHw
xercesc::XercesDOMParser * parser_
const XMLCh * kTagTypes
const XMLCh * kTagSlot
const XMLCh * kTagRunSettings