Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-22 01:53:28

0001 #ifndef FWCore_Framework_EventSetupImpl_h
0002 #define FWCore_Framework_EventSetupImpl_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Framework
0006 // Class:      EventSetupImpl
0007 //
0008 /**\class edm::EventSetupImpl
0009 
0010  Description: Container for all Records dealing with non-RunState info
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Author:      Chris Jones
0018 // Created:     Thu Mar 24 13:50:04 EST 2005
0019 //
0020 
0021 // system include files
0022 #include <map>
0023 #include <optional>
0024 #include <vector>
0025 
0026 // user include files
0027 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0028 #include "FWCore/Framework/interface/EventSetupRecord.h"
0029 #include "FWCore/Utilities/interface/ESIndices.h"
0030 
0031 // forward declarations
0032 
0033 class testEventsetup;
0034 
0035 namespace edm {
0036   class ESInputTag;
0037   class ProcessBlockTransitionInfo;
0038   class Schedule;
0039   class ServiceToken;
0040   class WaitingTaskHolder;
0041 
0042   namespace eventsetup {
0043     class EventSetupProvider;
0044     class EventSetupRecordImpl;
0045     class EventSetupRecordProvider;
0046   }  // namespace eventsetup
0047 
0048   class EventSetupImpl {
0049   public:
0050     ~EventSetupImpl();
0051     EventSetupImpl(EventSetupImpl const&) = delete;
0052     EventSetupImpl& operator=(EventSetupImpl const&) = delete;
0053 
0054     // ---------- const member functions ---------------------
0055     eventsetup::EventSetupRecordImpl const* findImpl(const eventsetup::EventSetupRecordKey&) const;
0056     eventsetup::EventSetupRecordImpl const* findImpl(ESRecordIndex) const;
0057 
0058     std::optional<eventsetup::EventSetupRecordGeneric> find(const eventsetup::EventSetupRecordKey&,
0059                                                             unsigned int iTransitionID,
0060                                                             ESProxyIndex const* getTokenIndices,
0061                                                             ESParentContext const& iParent) const;
0062 
0063     ///clears the oToFill vector and then fills it with the keys for all available records
0064     void fillAvailableRecordKeys(std::vector<eventsetup::EventSetupRecordKey>& oToFill) const;
0065 
0066     ///returns true if the Record is provided by a Source or a Producer
0067     /// a value of true does not mean this EventSetup object holds such a record
0068     bool recordIsProvidedByAModule(eventsetup::EventSetupRecordKey const&) const;
0069 
0070     bool validRecord(eventsetup::EventSetupRecordKey const& iKey) const;
0071 
0072     ///Only EventSetupProvider allowed to create an EventSetupImpl
0073     friend class eventsetup::EventSetupProvider;
0074     friend class eventsetup::EventSetupRecordProvider;
0075     friend class ::testEventsetup;
0076     friend class ::testEventsetupRecord;
0077     friend class ProcessBlockTransitionInfo;
0078 
0079   protected:
0080     void addRecordImpl(const eventsetup::EventSetupRecordImpl& iRecord);
0081 
0082   private:
0083     explicit EventSetupImpl();
0084 
0085     void insertRecordImpl(const eventsetup::EventSetupRecordKey&, const eventsetup::EventSetupRecordImpl*);
0086 
0087     void setKeyIters(std::vector<eventsetup::EventSetupRecordKey>::const_iterator const& keysBegin,
0088                      std::vector<eventsetup::EventSetupRecordKey>::const_iterator const& keysEnd);
0089 
0090     // ---------- member data --------------------------------
0091 
0092     std::vector<eventsetup::EventSetupRecordKey>::const_iterator keysBegin_;
0093     std::vector<eventsetup::EventSetupRecordKey>::const_iterator keysEnd_;
0094     std::vector<eventsetup::EventSetupRecordImpl const*> recordImpls_;
0095   };
0096 }  // namespace edm
0097 #endif