File indexing completed on 2025-04-30 22:24:06
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
0023
0024 #include <string_view>
0025 #include <vector>
0026
0027
0028 #include "FWCore/Utilities/interface/ESIndices.h"
0029
0030
0031
0032 namespace edm {
0033 namespace test {
0034 class ESTagGetterTester;
0035 }
0036 class ESTagGetter {
0037 public:
0038 friend test::ESTagGetterTester;
0039 struct Info {
0040 template <typename I, typename P, typename M>
0041 Info(I&& iIndex, P&& iProduct, M&& iModule)
0042 : index_(std::forward<I>(iIndex)),
0043 productLabel_(std::forward<P>(iProduct)),
0044 moduleLabel_(std::forward<M>(iModule)) {}
0045 ESResolverIndex index_;
0046 std::string productLabel_;
0047 std::string_view moduleLabel_;
0048 };
0049
0050 ESTagGetter() = default;
0051 ESTagGetter(ESTagGetter const&) = default;
0052 ESTagGetter(ESTagGetter&&) = default;
0053
0054 ESTagGetter(std::vector<Info> const& iLookup) : lookup_(iLookup) {}
0055
0056 ESTagGetter& operator=(ESTagGetter const&) = default;
0057 ESTagGetter& operator=(ESTagGetter&&) = default;
0058
0059
0060 ESResolverIndex operator()(std::string_view iModuleLabel, std::string_view iProductLabel) const;
0061
0062 ESResolverIndex nothing() const { return ESResolverIndex(); }
0063
0064
0065 bool hasNothingToGet() const { return lookup_.empty(); }
0066
0067 std::vector<Info> const& lookup() const { return lookup_; }
0068
0069 private:
0070 std::vector<Info> lookup_;
0071 };
0072 }
0073
0074 #endif