CMS 3D CMS Logo

List of all members | Public Member Functions
edm::ESProducerExternalWork Class Reference

#include <ESProducerExternalWork.h>

Inheritance diagram for edm::ESProducerExternalWork:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider edmtest::AcquireIntESProducer

Public Member Functions

 ESProducerExternalWork ()
 
template<typename T >
auto setWhatAcquiredProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatAcquiredProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatAcquiredProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatAcquiredProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TAcquireReturn , typename TProduceReturn , typename TRecord >
auto setWhatAcquiredProduced (T *iThis, TAcquireReturn(T::*iAcquireMethod)(const TRecord &, WaitingTaskWithArenaHolder), TProduceReturn(T::*iProduceMethod)(const TRecord &, TAcquireReturn), const es::Label &iLabel={})
 
template<typename T , typename TAcquireReturn , typename TProduceReturn , typename TRecord , typename TDecorator >
auto setWhatAcquiredProduced (T *iThis, TAcquireReturn(T::*iAcquireMethod)(const TRecord &, WaitingTaskWithArenaHolder), TProduceReturn(T ::*iProduceMethod)(const TRecord &, TAcquireReturn), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TAcquireFunc , typename TProduceFunc >
auto setWhatAcquiredProducedWithLambda (TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, const es::Label &iLabel={})
 
template<typename TAcquireReturn , typename TProduceReturn , typename TRecord , typename TAcquireFunc , typename TProduceFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatAcquiredProducedWithLambda (TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, TDecorator &&iDec, const es::Label &iLabel={})
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 37 of file ESProducerExternalWork.h.

Constructor & Destructor Documentation

◆ ESProducerExternalWork()

edm::ESProducerExternalWork::ESProducerExternalWork ( )

Definition at line 13 of file ESProducerExternalWork.cc.

13 {}

Member Function Documentation

◆ setWhatAcquiredProduced() [1/6]

template<typename T >
auto edm::ESProducerExternalWork::setWhatAcquiredProduced ( T iThis,
const es::Label iLabel = {} 
)
inline

Definition at line 46 of file ESProducerExternalWork.h.

Referenced by edmtest::AcquireIntESProducer::AcquireIntESProducer(), and setWhatAcquiredProduced().

46  {}) {
47  return setWhatAcquiredProduced(iThis, &T::acquire, &T::produce, iLabel);
48  }
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})

◆ setWhatAcquiredProduced() [2/6]

template<typename T >
auto edm::ESProducerExternalWork::setWhatAcquiredProduced ( T iThis,
const char *  iLabel 
)
inline

Definition at line 51 of file ESProducerExternalWork.h.

References setWhatAcquiredProduced().

51  {
52  return setWhatAcquiredProduced(iThis, es::Label(iLabel));
53  }
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})

◆ setWhatAcquiredProduced() [3/6]

template<typename T >
auto edm::ESProducerExternalWork::setWhatAcquiredProduced ( T iThis,
const std::string &  iLabel 
)
inline

Definition at line 55 of file ESProducerExternalWork.h.

References setWhatAcquiredProduced().

55  {
56  return setWhatAcquiredProduced(iThis, es::Label(iLabel));
57  }
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})

◆ setWhatAcquiredProduced() [4/6]

template<typename T , typename TDecorator >
auto edm::ESProducerExternalWork::setWhatAcquiredProduced ( T iThis,
const TDecorator &  iDec,
const es::Label iLabel = {} 
)
inline

Definition at line 64 of file ESProducerExternalWork.h.

64  {}) {
65  return setWhatAcquiredProduced(iThis, &T::acquire, &T::produce, iDec, iLabel);
66  }
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})

◆ setWhatAcquiredProduced() [5/6]

template<typename T , typename TAcquireReturn , typename TProduceReturn , typename TRecord >
auto edm::ESProducerExternalWork::setWhatAcquiredProduced ( T iThis,
TAcquireReturn(T::*)(const TRecord &, WaitingTaskWithArenaHolder iAcquireMethod,
TProduceReturn(T::*)(const TRecord &, TAcquireReturn)  iProduceMethod,
const es::Label iLabel = {} 
)
inline
Parameters
iThisthe 'this' pointer to an inheriting class instance
iAcquireMethoda member method of the inheriting class
iProduceMethoda member method of the inheriting class The TRecord and TReturn template parameters can be deduced from iAquireMethod and iPRoduceMethod in order to do the registration with the EventSetup

Definition at line 76 of file ESProducerExternalWork.h.

79  {}) {
81  iThis, iAcquireMethod, iProduceMethod, eventsetup::CallbackSimpleDecorator<TRecord>(), iLabel);
82  }
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})

◆ setWhatAcquiredProduced() [6/6]

template<typename T , typename TAcquireReturn , typename TProduceReturn , typename TRecord , typename TDecorator >
auto edm::ESProducerExternalWork::setWhatAcquiredProduced ( T iThis,
TAcquireReturn(T::*)(const TRecord &, WaitingTaskWithArenaHolder iAcquireMethod,
TProduceReturn(T ::*)(const TRecord &, TAcquireReturn)  iProduceMethod,
const TDecorator &  iDec,
const es::Label iLabel = {} 
)
inline

Definition at line 85 of file ESProducerExternalWork.h.

89  {}) {
90  return setWhatAcquiredProducedWithLambda<TAcquireReturn, TProduceReturn, TRecord>(
91  [iThis, iAcquireMethod](TRecord const& iRecord, WaitingTaskWithArenaHolder iHolder) {
92  return (iThis->*iAcquireMethod)(iRecord, std::move(iHolder));
93  },
94  [iThis, iProduceMethod](TRecord const& iRecord, TAcquireReturn iAcquireReturn) {
95  return (iThis->*iProduceMethod)(iRecord, std::move(iAcquireReturn));
96  },
97  createDecoratorFrom(iThis, static_cast<const TRecord*>(nullptr), iDec),
98  iLabel);
99  }
const TDecorator & createDecoratorFrom(T *, const TRecord *, const TDecorator &iDec)
Definition: ESProducer.h:99
def move(src, dest)
Definition: eostools.py:511

◆ setWhatAcquiredProducedWithLambda() [1/2]

template<typename TAcquireFunc , typename TProduceFunc >
auto edm::ESProducerExternalWork::setWhatAcquiredProducedWithLambda ( TAcquireFunc &&  acquireFunc,
TProduceFunc &&  produceFunc,
const es::Label iLabel = {} 
)
inline

This overload allows lambdas (functors) to be used as the production function. As of now it is not intended for wide use (we are thinking for a better API for users)

Definition at line 107 of file ESProducerExternalWork.h.

Referenced by edmtest::AcquireIntESProducer::AcquireIntESProducer().

109  {}) {
110  using AcquireTypes = eventsetup::impl::ReturnArgumentTypes<TAcquireFunc>;
111  using TRecord = typename AcquireTypes::argument_type;
112  using TAcquireReturn = typename AcquireTypes::return_type;
113  using TProduceReturn = std::invoke_result_t<TProduceFunc, TRecord const&, TAcquireReturn>;
114  using DecoratorType = eventsetup::CallbackSimpleDecorator<TRecord>;
115 
116  return setWhatAcquiredProducedWithLambda<TAcquireReturn, TProduceReturn, TRecord>(
117  std::forward<TAcquireFunc>(acquireFunc), std::forward<TProduceFunc>(produceFunc), DecoratorType(), iLabel);
118  }

◆ setWhatAcquiredProducedWithLambda() [2/2]

template<typename TAcquireReturn , typename TProduceReturn , typename TRecord , typename TAcquireFunc , typename TProduceFunc , typename TDecorator >
ESConsumesCollectorT<TRecord> edm::ESProducerExternalWork::setWhatAcquiredProducedWithLambda ( TAcquireFunc &&  acquireFunc,
TProduceFunc &&  produceFunc,
TDecorator &&  iDec,
const es::Label iLabel = {} 
)
inline

Definition at line 128 of file ESProducerExternalWork.h.

131  {}) {
132  const auto id = consumesInfoSize();
133  using DecoratorType = std::decay_t<TDecorator>;
134  using CallbackType = eventsetup::CallbackExternalWork<ESProducerExternalWork,
135  TAcquireFunc,
136  TAcquireReturn,
137  TProduceFunc,
138  TProduceReturn,
139  TRecord,
140  DecoratorType>;
141  unsigned int iovIndex = 0; // Start with 0, but later will cycle through all of them
142  auto temp = std::make_shared<CallbackType>(this,
143  std::forward<TAcquireFunc>(acquireFunc),
144  std::forward<TProduceFunc>(produceFunc),
145  id,
146  std::forward<TDecorator>(iDec));
147  auto callback =
148  std::make_shared<std::pair<unsigned int, std::shared_ptr<CallbackType>>>(iovIndex, std::move(temp));
150  static_cast<const typename eventsetup::produce::product_traits<TProduceReturn>::type*>(nullptr),
151  static_cast<const TRecord*>(nullptr),
152  iLabel);
153  return ESConsumesCollectorT<TRecord>(consumesInfoPushBackNew(), id);
154  }
ESConsumesInfo * consumesInfoPushBackNew()
Definition: ESProducer.h:248
void registerProducts(std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
Definition: ESProducer.h:254
unsigned int consumesInfoSize() const
Definition: ESProducer.h:246
def move(src, dest)
Definition: eostools.py:511