ATLAS Offline Software
IOVDbParser.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //@file IOVDbParser.h
6 //@brief helper class for IOVDbSvc implementing a simple XML-style parser to parse
7 // the folder description string or the provided folder description in job options
8 //@author Richard Hawkings, started 29/11/08
9 #ifndef IOVDBSVC_IOVDBPARSER_H
10 #define IOVDBSVC_IOVDBPARSER_H
11 
12 #include <string>
13 #include <map>
14 #include <vector>
15 #include "GaudiKernel/ClassID.h" //typedef
16 
17 class MsgStream;
18 
19 class IOVDbParser {
20 public:
21 
22  IOVDbParser() = delete;
23  IOVDbParser( const std::string &input, MsgStream& log);
24  bool isValid() const;
26  std::pair<std::string, bool>
27  at(const std::string & searchKey, const std::string & defaultValue="") const;
29  bool getKey(const std::string& key, const std::string& devvalue,std::string& value) const;
31  std::string folderName() const;
32  std::string key() const;
33  bool hasKey() const;
34  std::string tag() const;
35  std::string eventStoreName() const;
36  bool timebaseIs_nsOfEpoch() const;
37  std::string cache() const;
38  int cachehint() const;
39  bool named() const;
40  std::string addressHeader() const;
41  std::vector<std::string> symLinks() const;
42  bool noTagOverride() const;
43  CLID classId(MsgStream& msg) const;
44  bool onlyReadMetadata() const;
45  bool extensible() const;
46 
47  unsigned applyOverrides(const IOVDbParser& other, MsgStream & log);
49  bool overridesIov(MsgStream& msg) const;
52  bool overridesIov(MsgStream& msg, const bool folderIs_nsOfEpoch) const;
53  unsigned long long iovOverrideValue(MsgStream& msg) const;
54  bool operator==(const IOVDbParser& other) const;
55  std::string toString() const;
56  void clean();
57 
58 private:
59  bool m_valid;
60  typedef std::map<std::string, std::string> KeyValMap;
63  bool overridesIovImpl(MsgStream& msg, const bool performFolderCheck,const bool folderIs_nsOfEpoch=true) const;
64 
65 };
66 
67 inline bool IOVDbParser::isValid() const { return m_valid; }
68 
69 MsgStream& operator<<(MsgStream& os, const IOVDbParser& fldr);
70 
71 
72 #endif // IOVDBSVC_IOVDBPARSER_H
IOVDbParser::noTagOverride
bool noTagOverride() const
Definition: IOVDbParser.cxx:217
IOVDbParser::operator==
bool operator==(const IOVDbParser &other) const
Definition: IOVDbParser.cxx:257
IOVDbParser::cachehint
int cachehint() const
Definition: IOVDbParser.cxx:168
IOVDbParser::KeyValMap
std::map< std::string, std::string > KeyValMap
Definition: IOVDbParser.h:60
IOVDbParser::onlyReadMetadata
bool onlyReadMetadata() const
Definition: IOVDbParser.cxx:179
athena.value
value
Definition: athena.py:122
IOVDbParser::overridesIov
bool overridesIov(MsgStream &msg) const
return true if this description overrides the timestamp or runlumi
Definition: IOVDbParser.cxx:262
IOVDbParser::m_valid
bool m_valid
Definition: IOVDbParser.h:59
IOVDbParser::named
bool named() const
Definition: IOVDbParser.cxx:174
LArConditions2Ntuple.fldr
string fldr
Definition: LArConditions2Ntuple.py:216
IOVDbParser::at
std::pair< std::string, bool > at(const std::string &searchKey, const std::string &defaultValue="") const
'at' accessor with an optional default; the bool is true if the key was found
Definition: IOVDbParser.cxx:123
IOVDbParser::extensible
bool extensible() const
Definition: IOVDbParser.cxx:184
IOVDbParser::isValid
bool isValid() const
Definition: IOVDbParser.h:67
IOVDbParser::cache
std::string cache() const
Definition: IOVDbParser.cxx:163
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
IOVDbParser::IOVDbParser
IOVDbParser()=delete
IOVDbParser::iovOverrideValue
unsigned long long iovOverrideValue(MsgStream &msg) const
Definition: IOVDbParser.cxx:301
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
IOVDbParser::key
std::string key() const
Definition: IOVDbParser.cxx:138
IOVDbParser::toString
std::string toString() const
Definition: IOVDbParser.cxx:320
IOVDbParser::tag
std::string tag() const
Definition: IOVDbParser.cxx:148
IOVDbParser::getKey
bool getKey(const std::string &key, const std::string &devvalue, std::string &value) const
original 'getKey' method, now implemented using 'at'
Definition: IOVDbParser.cxx:108
IOVDbParser
Definition: IOVDbParser.h:19
IOVDbParser::timebaseIs_nsOfEpoch
bool timebaseIs_nsOfEpoch() const
Definition: IOVDbParser.cxx:158
IOVDbParser::symLinks
std::vector< std::string > symLinks() const
Definition: IOVDbParser.cxx:211
IOVDbParser::overridesIovImpl
bool overridesIovImpl(MsgStream &msg, const bool performFolderCheck, const bool folderIs_nsOfEpoch=true) const
implementation of overridesIov, with or without check on folder compatibility
Definition: IOVDbParser.cxx:274
IOVDbParser::applyOverrides
unsigned applyOverrides(const IOVDbParser &other, MsgStream &log)
Definition: IOVDbParser.cxx:233
IOVDbParser::folderName
std::string folderName() const
give the folder name contained in the parsed description
Definition: IOVDbParser.cxx:133
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
IOVDbParser::clean
void clean()
Definition: IOVDbParser.cxx:222
IOVDbParser::hasKey
bool hasKey() const
Definition: IOVDbParser.cxx:143
operator<<
MsgStream & operator<<(MsgStream &os, const IOVDbParser &fldr)
Definition: IOVDbParser.cxx:334
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IOVDbParser::classId
CLID classId(MsgStream &msg) const
Definition: IOVDbParser.cxx:190
IOVDbParser::addressHeader
std::string addressHeader() const
Definition: IOVDbParser.cxx:206
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
IOVDbParser::eventStoreName
std::string eventStoreName() const
Definition: IOVDbParser.cxx:153
IOVDbParser::m_keys
KeyValMap m_keys
Definition: IOVDbParser.h:61