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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider 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
 
ESProxyIndex 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< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- 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::ESProxyFactoryProducer
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::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
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.

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

◆ 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 129 of file ESProducerExternalWork.h.

132  {}) {
133  const auto id = consumesInfoSize();
134  using DecoratorType = std::decay_t<TDecorator>;
135  using CallbackType = eventsetup::CallbackExternalWork<ESProducerExternalWork,
136  TAcquireFunc,
137  TAcquireReturn,
138  TProduceFunc,
139  TProduceReturn,
140  TRecord,
141  DecoratorType>;
142  unsigned int iovIndex = 0; // Start with 0, but later will cycle through all of them
143  auto temp = std::make_shared<CallbackType>(this,
144  std::forward<TAcquireFunc>(acquireFunc),
145  std::forward<TProduceFunc>(produceFunc),
146  id,
147  std::forward<TDecorator>(iDec));
148  auto callback =
149  std::make_shared<std::pair<unsigned int, std::shared_ptr<CallbackType>>>(iovIndex, std::move(temp));
151  static_cast<const typename eventsetup::produce::product_traits<TProduceReturn>::type*>(nullptr),
152  static_cast<const TRecord*>(nullptr),
153  iLabel);
154  return ESConsumesCollectorT<TRecord>(consumesInfoPushBackNew(), id);
155  }
ESConsumesInfo * consumesInfoPushBackNew()
Definition: ESProducer.h:247
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:253
unsigned int consumesInfoSize() const
Definition: ESProducer.h:245
def move(src, dest)
Definition: eostools.py:511