Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:43

0001 #ifndef FWCore_Framework_DependentRecordIntervalFinder_h
0002 #define FWCore_Framework_DependentRecordIntervalFinder_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework
0006 // Class  :     DependentRecordIntervalFinder
0007 //
0008 /**\class edm::eventsetup::DependentRecordIntervalFinder
0009 
0010  Description: Finds the intersection of the ValidityInterval for several Providers
0011 
0012  Usage:
0013     This class is used internally to a EventSetupRecordProvider which delivers a Record that is dependent on other Records.
0014 
0015     If no Providers are given, then Finder will always report an invalid ValidityInterval for all IOVSyncValues
0016 
0017 */
0018 //
0019 // Author:      Chris Jones
0020 // Created:     Sat Apr 30 19:36:59 EDT 2005
0021 //
0022 
0023 // system include files
0024 #include <memory>
0025 #include <vector>
0026 
0027 // user include files
0028 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0029 #include "FWCore/Utilities/interface/propagate_const.h"
0030 
0031 // forward declarations
0032 namespace edm {
0033   namespace eventsetup {
0034     class EventSetupRecordProvider;
0035 
0036     class DependentRecordIntervalFinder : public EventSetupRecordIntervalFinder {
0037     public:
0038       DependentRecordIntervalFinder(const EventSetupRecordKey&);
0039       DependentRecordIntervalFinder(const DependentRecordIntervalFinder&) = delete;
0040       const DependentRecordIntervalFinder& operator=(const DependentRecordIntervalFinder&) = delete;
0041       ~DependentRecordIntervalFinder() override;
0042 
0043       // ---------- const member functions ---------------------
0044       bool haveProviders() const { return !providers_.empty(); }
0045 
0046       // ---------- static member functions --------------------
0047 
0048       // ---------- member functions ---------------------------
0049       void addProviderWeAreDependentOn(std::shared_ptr<EventSetupRecordProvider>);
0050 
0051       void setAlternateFinder(std::shared_ptr<EventSetupRecordIntervalFinder>);
0052 
0053     protected:
0054       void setIntervalFor(const EventSetupRecordKey&, const IOVSyncValue&, ValidityInterval&) override;
0055 
0056     private:
0057       void doResetInterval(const eventsetup::EventSetupRecordKey&) override;
0058 
0059       // Should never be called for this class
0060       bool isConcurrentFinder() const override;
0061 
0062       bool isNonconcurrentAndIOVNeedsUpdate(const EventSetupRecordKey&, const IOVSyncValue&) const override;
0063       // ---------- member data --------------------------------
0064       typedef std::vector<edm::propagate_const<std::shared_ptr<EventSetupRecordProvider>>> Providers;
0065       Providers providers_;
0066 
0067       edm::propagate_const<std::shared_ptr<EventSetupRecordIntervalFinder>> alternate_;
0068       std::vector<ValidityInterval> previousIOVs_;
0069     };
0070 
0071   }  // namespace eventsetup
0072 }  // namespace edm
0073 #endif