ATLAS Offline Software
PathResolver.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PATHRESOLVER_PATHRESOLVER_H
6 #define PATHRESOLVER_PATHRESOLVER_H
7 
9 
10 #include <string>
11 #include <atomic>
12 
13 
15 
16 {
17 public:
18  typedef enum
19  {
20  Ok,
24 
25  typedef enum
26  {
30 
31  typedef enum {
35 
36  PathResolver(); //need a constructor to link the dictionary library with the implementation library
37 
48  static std::string find_file (const std::string& logical_file_name,
49  const std::string& search_path,
50  SearchType search_type = LocalSearch);
51 
61  static std::string find_file_from_list (const std::string& logical_file_name,
62  const std::string& search_list,
63  SearchType search_type = LocalSearch);
64 
65 
75  static std::string find_directory (const std::string& logical_file_name,
76  const std::string& search_path,
77  SearchType search_type = LocalSearch);
78 
88  static std::string find_directory_from_list (const std::string& logical_file_name,
89  const std::string& search_list,
90  SearchType search_type = LocalSearch);
91 
92 
100  static SearchPathStatus check_search_path (const std::string& search_path);
101 
102 
103  static std::string find_calib_file(const std::string& logical_file_name);
104  static std::string find_calib_directory(const std::string& logical_file_name);
105 
106  static void setOutputLevel(MSG::Level level);
107 
108  inline static std::string FindCalibFile(const std::string& logical_file_name) { return find_calib_file(logical_file_name); }
109  inline static std::string FindCalibDirectory(const std::string& logical_file_name) { return find_calib_directory(logical_file_name); }
110  inline static void SetOutputLevel(int lvl) { setOutputLevel(MSG::Level(lvl)); }
111 
112  private:
113  static bool PR_find( const std::string& logical_file_name, const std::string& search_list, PR_file_type file_type, SearchType search_type,
114  std::string& result );
115 
116 
117  static std::atomic<MSG::Level> m_level;
118 
119  static bool msgLvl( const MSG::Level lvl ) { return asgMsg().msgLvl(lvl); }
120  static MsgStream& msg() { return asgMsg().msg(); }
121  static MsgStream& msg( const MSG::Level lvl ) { return asgMsg().msg(lvl); }
122  static asg::AsgMessaging& asgMsg();
123 
124 
125 };
126 
127 std::string PathResolverFindXMLFile (const std::string& logical_file_name);
128 std::string PathResolverFindDataFile (const std::string& logical_file_name);
129 std::string PathResolverFindCalibFile (const std::string& logical_file_name);
130 std::string PathResolverFindCalibDirectory (const std::string& logical_file_name);
131 void PathResolverSetOutputLevel(int lvl);
132 
133 #endif
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:384
PathResolver::EnvironmentVariableUndefined
@ EnvironmentVariableUndefined
Definition: PathResolver.h:21
PathResolver::asgMsg
static asg::AsgMessaging & asgMsg()
Definition: PathResolver.cxx:96
PathResolver::SearchType
SearchType
Definition: PathResolver.h:26
PathResolver::RecursiveSearch
@ RecursiveSearch
Definition: PathResolver.h:28
PathResolver::FindCalibFile
static std::string FindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.h:108
get_generator_info.result
result
Definition: get_generator_info.py:21
asg::AsgMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level of the object.
Definition: AsgMessaging.cxx:41
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
PathResolver::Ok
@ Ok
Definition: PathResolver.h:20
PathResolver::find_calib_directory
static std::string find_calib_directory(const std::string &logical_file_name)
Definition: PathResolver.cxx:413
PathResolver::PathResolver
PathResolver()
Definition: PathResolver.cxx:94
PathResolver::m_level
static std::atomic< MSG::Level > m_level
Definition: PathResolver.h:117
PathResolver::find_directory
static std::string find_directory(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:307
PathResolver::msg
static MsgStream & msg(const MSG::Level lvl)
Definition: PathResolver.h:121
PathResolver::FindCalibDirectory
static std::string FindCalibDirectory(const std::string &logical_file_name)
Definition: PathResolver.h:109
PathResolver::msgLvl
static bool msgLvl(const MSG::Level lvl)
Definition: PathResolver.h:119
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
PathResolverFindCalibDirectory
std::string PathResolverFindCalibDirectory(const std::string &logical_file_name)
Definition: PathResolver.cxx:432
PathResolver::LocalSearch
@ LocalSearch
Definition: PathResolver.h:27
AsgMessaging.h
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
PathResolver::msg
static MsgStream & msg()
Definition: PathResolver.h:120
PathResolver::PR_directory
@ PR_directory
Definition: PathResolver.h:33
PathResolver::SetOutputLevel
static void SetOutputLevel(int lvl)
Definition: PathResolver.h:110
PathResolverFindXMLFile
std::string PathResolverFindXMLFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:374
PathResolver::check_search_path
static SearchPathStatus check_search_path(const std::string &search_path)
Definition: PathResolver.cxx:348
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
PathResolver::PR_find
static bool PR_find(const std::string &logical_file_name, const std::string &search_list, PR_file_type file_type, SearchType search_type, std::string &result)
Definition: PathResolver.cxx:122
PathResolver::find_file_from_list
static std::string find_file_from_list(const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:281
PathResolver::SearchPathStatus
SearchPathStatus
Definition: PathResolver.h:19
PathResolver::find_directory_from_list
static std::string find_directory_from_list(const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:330
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
PathResolver::PR_file_type
PR_file_type
Definition: PathResolver.h:31
PathResolver::PR_regular_file
@ PR_regular_file
Definition: PathResolver.h:32
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
PathResolverFindDataFile
std::string PathResolverFindDataFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:379
PathResolver::setOutputLevel
static void setOutputLevel(MSG::Level level)
Definition: PathResolver.cxx:426
PathResolver
Definition: PathResolver.h:16
PathResolver::UnknownDirectory
@ UnknownDirectory
Definition: PathResolver.h:22
PathResolverSetOutputLevel
void PathResolverSetOutputLevel(int lvl)
Definition: PathResolver.cxx:433