ATLAS Offline Software
ReadFromXmlDom.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 //
5 // ReadFromXmlDom.h
6 // HDef
7 //
8 // Created by sroe on 15/03/2016.
9 //
10 
11 #ifndef IDVPM_ReadFromXmlDom_h
12 #define IDVPM_ReadFromXmlDom_h
13 #include "IReadHistoDef.h"
14 #include <vector>
16 #include <xercesc/parsers/XercesDOMParser.hpp>
17 
19 ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // Not sure if usage of Xerces-C++ here is thread safe.
20 // The following warning message is given if checked:
21 // warning: Use of static expression 'xercesc_3_1::XMLPlatformUtils::fgMemoryManager'
22 // of type 'xercesc_3_1::MemoryManager*' within function
23 // 'toNative(const XMLCh*)::<lambda(char*)>' may not be thread-safe.
24 //
25 // https://xerces.apache.org/xerces-c/faq-parse-3.html#faq-6
26 // Is Xerces-C++ thread-safe?
27 // The answer is yes if you observe the following rules for using Xerces-C++
28 // in a multi-threaded environment:
29 // ... ...
30 
32 public:
34  ReadFromXmlDom(const std::string& source);
35  std::string source() const final;
36  std::string format() const final;
37  bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersMap) const final;
38  bool insertDefinition(const SingleHistogramDefinition& oneDefinition);
39  bool initialize() final;
40  bool sourceExists() const final;
41 private:
42  std::vector <SingleHistogramDefinition> m_vectorOfDefinitions;
43  std::string m_source;
44  const std::string m_format;
45  static SingleHistogramDefinition parseTextLine(const std::string& line);
46  static SingleHistogramDefinition parseTProfileText(const std::string& line);
47  static SingleHistogramDefinition parseXmlElement(const xercesc::DOMElement* element);
48 };
49 #endif /* ReadFromXmlDom_h */
SingleHistogramDefinition.h
ReadFromXmlDom::parseTProfileText
static SingleHistogramDefinition parseTProfileText(const std::string &line)
Definition: ReadFromXmlDom.cxx:265
checkFileSG.line
line
Definition: checkFileSG.py:75
ReadFromXmlDom::histoDefinitionMap
bool histoDefinitionMap(std::map< std::string, SingleHistogramDefinition > &usersMap) const final
Definition: ReadFromXmlDom.cxx:63
ReadFromXmlDom::initialize
bool initialize() final
Definition: ReadFromXmlDom.cxx:92
IReadHistoDef
Definition: IReadHistoDef.h:16
ReadFromXmlDom::m_source
std::string m_source
Definition: ReadFromXmlDom.h:43
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: ReadFromXmlDom.h:19
ReadFromXmlDom::sourceExists
bool sourceExists() const final
Definition: ReadFromXmlDom.cxx:128
ReadFromXmlDom::m_format
const std::string m_format
Definition: ReadFromXmlDom.h:44
ReadFromXmlDom::m_vectorOfDefinitions
std::vector< SingleHistogramDefinition > m_vectorOfDefinitions
Definition: ReadFromXmlDom.h:42
IReadHistoDef.h
SingleHistogramDefinition
Almost-a-struct for holding the single histogram definition.
Definition: SingleHistogramDefinition.h:17
ReadFromXmlDom
Definition: ReadFromXmlDom.h:31
ReadFromXmlDom::parseTextLine
static SingleHistogramDefinition parseTextLine(const std::string &line)
Definition: ReadFromXmlDom.cxx:238
ReadFromXmlDom::source
std::string source() const final
Definition: ReadFromXmlDom.cxx:53
ReadFromXmlDom::parseXmlElement
static SingleHistogramDefinition parseXmlElement(const xercesc::DOMElement *element)
Definition: ReadFromXmlDom.cxx:135
ReadFromXmlDom::insertDefinition
bool insertDefinition(const SingleHistogramDefinition &oneDefinition)
Definition: ReadFromXmlDom.cxx:84
checker_macros.h
Define macros for attributes used to control the static checker.
ReadFromXmlDom::format
std::string format() const final
Definition: ReadFromXmlDom.cxx:58
ReadFromXmlDom::ReadFromXmlDom
ReadFromXmlDom()
Definition: ReadFromXmlDom.cxx:43