File indexing completed on 2024-09-12 04:16:27
0001
0002 #ifndef FWCore_Framework_ESRecordsToProductResolverIndices_h
0003 #define FWCore_Framework_ESRecordsToProductResolverIndices_h
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <vector>
0023
0024
0025 #include "FWCore/Framework/interface/DataKey.h"
0026 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0027 #include "FWCore/Framework/interface/ESTagGetter.h"
0028 #include "FWCore/Utilities/interface/ESIndices.h"
0029
0030
0031 namespace edm::eventsetup {
0032 struct ComponentDescription;
0033
0034 class ESRecordsToProductResolverIndices {
0035 public:
0036 ESRecordsToProductResolverIndices(std::vector<EventSetupRecordKey> iRecords);
0037
0038
0039
0040 ESResolverIndex indexInRecord(EventSetupRecordKey const& iRK, DataKey const& iDK) const noexcept;
0041
0042 ComponentDescription const* component(EventSetupRecordKey const& iRK, DataKey const& iDK) const noexcept;
0043
0044
0045 ESTagGetter makeTagGetter(EventSetupRecordKey const& iRK, TypeTag const& iTT) const;
0046
0047 static constexpr ESRecordIndex missingRecordIndex() noexcept {
0048 return ESRecordIndex{ESRecordIndex::invalidValue()};
0049 }
0050
0051 ESRecordIndex recordIndexFor(EventSetupRecordKey const& iRK) const noexcept;
0052
0053 std::pair<std::vector<DataKey>::const_iterator, std::vector<DataKey>::const_iterator> keysForRecord(
0054 EventSetupRecordKey const& iRK) const noexcept;
0055
0056 std::vector<EventSetupRecordKey> recordKeys() const noexcept { return recordKeys_; }
0057
0058
0059
0060
0061 unsigned int dataKeysInRecord(unsigned int iRecordIndex,
0062 EventSetupRecordKey const& iRecord,
0063 std::vector<DataKey> const& iDataKeys,
0064 std::vector<ComponentDescription const*> const& iComponents);
0065
0066 private:
0067
0068 std::vector<EventSetupRecordKey> recordKeys_;
0069
0070
0071
0072
0073 std::vector<unsigned int> recordOffsets_;
0074 std::vector<DataKey> dataKeys_;
0075 std::vector<ComponentDescription const*> components_;
0076 };
0077
0078 }
0079 #endif