ATLAS Offline Software
Loading...
Searching...
No Matches
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
17class MsgStream;
18
20public:
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
58private:
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
67inline bool IOVDbParser::isValid() const { return m_valid; }
68
69MsgStream& operator<<(MsgStream& os, const IOVDbParser& fldr);
70
71
72#endif // IOVDBSVC_IOVDBPARSER_H
uint32_t CLID
The Class ID type.
MsgStream & operator<<(MsgStream &os, const IOVDbParser &fldr)
bool overridesIovImpl(MsgStream &msg, const bool performFolderCheck, const bool folderIs_nsOfEpoch=true) const
implementation of overridesIov, with or without check on folder compatibility
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
std::string toString() const
std::vector< std::string > symLinks() const
std::string key() const
int cachehint() const
std::string cache() const
bool isValid() const
Definition IOVDbParser.h:67
CLID classId(MsgStream &msg) const
bool onlyReadMetadata() const
bool named() const
bool getKey(const std::string &key, const std::string &devvalue, std::string &value) const
original 'getKey' method, now implemented using 'at'
std::string eventStoreName() const
bool hasKey() const
bool timebaseIs_nsOfEpoch() const
unsigned long long iovOverrideValue(MsgStream &msg) const
bool overridesIov(MsgStream &msg) const
return true if this description overrides the timestamp or runlumi
bool operator==(const IOVDbParser &other) const
bool extensible() const
std::map< std::string, std::string > KeyValMap
Definition IOVDbParser.h:60
bool noTagOverride() const
KeyValMap m_keys
Definition IOVDbParser.h:61
std::string addressHeader() const
unsigned applyOverrides(const IOVDbParser &other, MsgStream &log)
std::string folderName() const
give the folder name contained in the parsed description
std::string tag() const
IOVDbParser()=delete
MsgStream & msg
Definition testRead.cxx:32