File indexing completed on 2024-04-06 12:12:02
0001 #ifndef FWCore_Framework_ESTagGetter_h
0002 #define FWCore_Framework_ESTagGetter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <string_view>
0023 #include <vector>
0024
0025
0026 #include "FWCore/Utilities/interface/ESIndices.h"
0027
0028
0029
0030 namespace edm {
0031 namespace test {
0032 class ESTagGetterTester;
0033 }
0034 class ESTagGetter {
0035 public:
0036 friend test::ESTagGetterTester;
0037 struct Info {
0038 template <typename I, typename P, typename M>
0039 Info(I&& iIndex, P&& iProduct, M&& iModule)
0040 : index_(std::forward<I>(iIndex)),
0041 productLabel_(std::forward<P>(iProduct)),
0042 moduleLabel_(std::forward<M>(iModule)) {}
0043 ESResolverIndex index_;
0044 std::string productLabel_;
0045 std::string_view moduleLabel_;
0046 };
0047
0048 ESTagGetter() = default;
0049 ESTagGetter(ESTagGetter const&) = default;
0050 ESTagGetter(ESTagGetter&&) = default;
0051
0052 ESTagGetter(std::vector<Info> const& iLookup) : lookup_(iLookup) {}
0053
0054 ESTagGetter& operator=(ESTagGetter const&) = default;
0055 ESTagGetter& operator=(ESTagGetter&&) = default;
0056
0057
0058 ESResolverIndex operator()(std::string_view iModuleLabel, std::string_view iProductLabel) const;
0059
0060 ESResolverIndex nothing() const { return ESResolverIndex(); }
0061
0062
0063 bool hasNothingToGet() const { return lookup_.empty(); }
0064
0065 private:
0066 std::vector<Info> lookup_;
0067 };
0068 }
0069
0070 #endif