CMS 3D CMS Logo

FileLocator.h
Go to the documentation of this file.
1 #ifndef FWCore_Catalog_FileLocator_h
2 #define FWCore_Catalog_FileLocator_h
3 
4 #include <string>
5 #include <list>
6 #include <map>
7 #include <utility>
8 #include <regex>
9 #include "tinyxml2.h"
10 
11 namespace edm {
12 
13  class FileLocator {
14  public:
15  explicit FileLocator(std::string const& catUrl, unsigned iCatalog = 0);
16  ~FileLocator();
17 
18  std::string pfn(std::string const& ilfn) const;
19  std::string lfn(std::string const& ipfn) const;
20 
21  private:
25  static int s_numberOfInstances;
26 
27  struct Rule {
28  std::regex pathMatch;
29  std::regex destinationMatch;
32  };
33 
34  typedef std::vector<Rule> Rules;
35  typedef std::map<std::string, Rules> ProtocolRules;
36 
37  void init(std::string const& catUrl, unsigned iCatalog);
38 
39  void parseRule(tinyxml2::XMLElement* ruleNode, ProtocolRules& rules);
40 
41  std::string applyRules(ProtocolRules const& protocolRules,
42  std::string const& protocol,
43  std::string const& destination,
44  bool direct,
45  std::string name) const;
46 
47  std::string convert(std::string const& input, ProtocolRules const& rules, bool direct) const;
48 
53 
56  std::vector<std::string> m_protocols;
58  };
59 } // namespace edm
60 
61 #endif // FWCore_Catalog_FileLocator_h
input
static const std::string input
Definition: EdmProvDump.cc:48
edm::FileLocator
Definition: FileLocator.h:13
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::FileLocator::Rule::pathMatch
std::regex pathMatch
Definition: FileLocator.h:28
edm::FileLocator::convert
std::string convert(std::string const &input, ProtocolRules const &rules, bool direct) const
Definition: FileLocator.cc:58
edm::FileLocator::Rule
Definition: FileLocator.h:27
edm::FileLocator::pfn
std::string pfn(std::string const &ilfn) const
Definition: FileLocator.cc:54
edm::FileLocator::m_inverseRules
ProtocolRules m_inverseRules
Definition: FileLocator.h:52
edm::FileLocator::~FileLocator
~FileLocator()
Definition: FileLocator.cc:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::FileLocator::m_protocols
std::vector< std::string > m_protocols
Definition: FileLocator.h:56
edm::FileLocator::lfn
std::string lfn(std::string const &ipfn) const
Definition: FileLocator.cc:56
edm::FileLocator::m_destination
std::string m_destination
Definition: FileLocator.h:57
edm::FileLocator::m_filename
std::string m_filename
Definition: FileLocator.h:55
edm::FileLocator::m_fileType
std::string m_fileType
Definition: FileLocator.h:54
edm::FileLocator::init
void init(std::string const &catUrl, unsigned iCatalog)
Definition: FileLocator.cc:92
edm::FileLocator::Rule::result
std::string result
Definition: FileLocator.h:30
edm::FileLocator::ProtocolRules
std::map< std::string, Rules > ProtocolRules
Definition: FileLocator.h:35
edm::FileLocator::Rules
std::vector< Rule > Rules
Definition: FileLocator.h:34
HLTMuonOfflineAnalyzer_cff.destination
destination
Definition: HLTMuonOfflineAnalyzer_cff.py:50
edm::FileLocator::parseRule
void parseRule(tinyxml2::XMLElement *ruleNode, ProtocolRules &rules)
Definition: FileLocator.cc:69
edm::FileLocator::m_directRules
ProtocolRules m_directRules
Definition: FileLocator.h:50
edm::FileLocator::FileLocator
FileLocator(std::string const &catUrl, unsigned iCatalog=0)
Definition: FileLocator.cc:45
edm::FileLocator::s_numberOfInstances
static int s_numberOfInstances
Definition: FileLocator.h:25
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cmsCodeRulesChecker.rules
rules
Definition: cmsCodeRulesChecker.py:152
edm::FileLocator::applyRules
std::string applyRules(ProtocolRules const &protocolRules, std::string const &protocol, std::string const &destination, bool direct, std::string name) const
Definition: FileLocator.cc:190
edm::FileLocator::Rule::destinationMatch
std::regex destinationMatch
Definition: FileLocator.h:29
edm::FileLocator::Rule::chain
std::string chain
Definition: FileLocator.h:31