File indexing completed on 2024-04-06 12:12:03
0001 #ifndef Framework_EventSetupRecordIntervalFinder_h
0002 #define Framework_EventSetupRecordIntervalFinder_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <map>
0023 #include <set>
0024
0025
0026 #include "FWCore/Framework/interface/ValidityInterval.h"
0027 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0028 #include "FWCore/Framework/interface/ComponentDescription.h"
0029
0030
0031 namespace edm {
0032
0033 class EventSetupRecordIntervalFinder {
0034 public:
0035 EventSetupRecordIntervalFinder() : intervals_() {}
0036 EventSetupRecordIntervalFinder(const EventSetupRecordIntervalFinder&) = delete;
0037 const EventSetupRecordIntervalFinder& operator=(const EventSetupRecordIntervalFinder&) = delete;
0038 virtual ~EventSetupRecordIntervalFinder() noexcept(false);
0039
0040
0041 std::set<eventsetup::EventSetupRecordKey> findingForRecords() const;
0042
0043 const eventsetup::ComponentDescription& descriptionForFinder() const { return description_; }
0044
0045
0046
0047
0048
0049
0050 const ValidityInterval& findIntervalFor(const eventsetup::EventSetupRecordKey&, const IOVSyncValue&);
0051
0052 void resetInterval(const eventsetup::EventSetupRecordKey&);
0053
0054 bool concurrentFinder() const { return isConcurrentFinder(); }
0055
0056 bool nonconcurrentAndIOVNeedsUpdate(const eventsetup::EventSetupRecordKey& key,
0057 const IOVSyncValue& syncValue) const {
0058 return isNonconcurrentAndIOVNeedsUpdate(key, syncValue);
0059 }
0060
0061 void setDescriptionForFinder(const eventsetup::ComponentDescription& iDescription) { description_ = iDescription; }
0062
0063 protected:
0064 virtual void setIntervalFor(const eventsetup::EventSetupRecordKey&, const IOVSyncValue&, ValidityInterval&) = 0;
0065
0066 template <class T>
0067 void findingRecord() {
0068 findingRecordWithKey(eventsetup::EventSetupRecordKey::makeKey<T>());
0069 }
0070
0071 void findingRecordWithKey(const eventsetup::EventSetupRecordKey&);
0072
0073 private:
0074 virtual void doResetInterval(const eventsetup::EventSetupRecordKey&);
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 virtual bool isConcurrentFinder() const;
0089
0090
0091
0092 virtual bool isNonconcurrentAndIOVNeedsUpdate(const eventsetup::EventSetupRecordKey&, const IOVSyncValue&) const;
0093
0094
0095 virtual void delaySettingRecords();
0096
0097 using Intervals = std::map<eventsetup::EventSetupRecordKey, ValidityInterval>;
0098 Intervals intervals_;
0099
0100 eventsetup::ComponentDescription description_;
0101 };
0102
0103 }
0104 #endif