Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-04-30 22:24:06

0001 #ifndef FWCore_Framework_ESModuleConsumesMinimalInfo_h
0002 #define FWCore_Framework_ESModuleConsumesMinimalInfo_h
0003 
0004 // -*- C++ -*-
0005 // Package:     FWCore/Framework
0006 // Class  :     ESModuleConsumesMinimalInfo
0007 // Minimal information about the consumes call for an EventSetup product by an ESModule
0008 
0009 #include "FWCore/Utilities/interface/ESIndices.h"
0010 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0011 #include "FWCore/Framework/interface/DataKey.h"
0012 #include <string_view>
0013 
0014 namespace edm::eventsetup {
0015   struct ESModuleConsumesMinimalInfo {
0016     ESModuleConsumesMinimalInfo(unsigned int iProduceMethodID,
0017                                 eventsetup::EventSetupRecordKey const& iRecord,
0018                                 eventsetup::DataKey const& iDataKey,
0019                                 std::string_view iComponentLabel)
0020         : recordForDataKey_(iRecord),
0021           dataKey_(iDataKey.type(), iDataKey.name(), eventsetup::DataKey::DoNotCopyMemory()),
0022           componentLabel_(iComponentLabel),
0023           produceMethodID_(iProduceMethodID) {}
0024     ESModuleConsumesMinimalInfo() = default;
0025     ESModuleConsumesMinimalInfo(ESModuleConsumesMinimalInfo&&) = default;
0026     ESModuleConsumesMinimalInfo& operator=(ESModuleConsumesMinimalInfo&&) = default;
0027 
0028     // avoid accidentally copying data key as the strings would be copied instead of shared
0029     ESModuleConsumesMinimalInfo(ESModuleConsumesMinimalInfo const&) = delete;
0030     ESModuleConsumesMinimalInfo& operator=(ESModuleConsumesMinimalInfo const&) = delete;
0031 
0032     eventsetup::EventSetupRecordKey recordForDataKey_;
0033     eventsetup::DataKey dataKey_;
0034     std::string_view componentLabel_;
0035     unsigned int produceMethodID_ = 0;
0036   };
0037 }  // namespace edm::eventsetup
0038 #endif  // FWCore_Framework_ESModuleConsumesMinimalInfo_h