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