LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ServiceNames.h
Go to the documentation of this file.
1 #ifndef art_Framework_Art_detail_ServiceNames_h
2 #define art_Framework_Art_detail_ServiceNames_h
3 
4 /*
5  The existence of this class is unfortunate. It stems from having to
6  tell the user that some configurable system services have .so files
7  whose base names differ from those that can be specified in a user's
8  configuration file. For example, the
9  'FloatingPointControl_service.so' is loaded in FHiCL by specifying
10  'floating_point_control'. This flexibility in the system should be
11  removed so we don't have to go through these unnecessary gymnastics
12  and can have uniformity in treatment.
13 
14  This class is used ONLY FOR STREAMING to stdout. Please don't use
15  it for anything else.
16 
17  KK, June 2015
18 */
19 
20 #include "boost/bimap.hpp"
21 
22 #include <string>
23 
24 namespace bimaps = boost::bimaps;
25 
26 namespace art {
27  namespace detail {
28 
29  class ServiceNames {
30  public:
31  using ServiceNames_bimap_t =
32  boost::bimap<bimaps::set_of<std::string>, bimaps::set_of<std::string>>;
33 
34  static std::string const&
35  libname(std::string const& fclname)
36  {
37  auto it = lookup_.left.find(fclname);
38  return it == lookup_.left.end() ? fclname : it->second;
39  }
40 
41  static std::string const&
42  fclname(std::string const& libname)
43  {
44  auto it = lookup_.right.find(libname);
45  return it == lookup_.right.end() ? libname : it->second;
46  }
47 
48  private:
50  };
51  }
52 }
53 
54 #endif /* art_Framework_Art_detail_ServiceNames_h */
55 
56 // Local variables:
57 // mode: c++
58 // End:
static ServiceNames_bimap_t lookup_
Definition: ServiceNames.h:49
static std::string const & libname(std::string const &fclname)
Definition: ServiceNames.h:35
static std::string const & fclname(std::string const &libname)
Definition: ServiceNames.h:42
HLT enums.
boost::bimap< bimaps::set_of< std::string >, bimaps::set_of< std::string >> ServiceNames_bimap_t
Definition: ServiceNames.h:32