2 #ifndef FWCore_Framework_ESProducerExternalWork_h 3 #define FWCore_Framework_ESProducerExternalWork_h 23 #include <type_traits> 63 template <
typename T,
typename TDecorator>
75 template <
typename T,
typename TAcquireReturn,
typename TProduceReturn,
typename TRecord>
78 TProduceReturn (
T::*iProduceMethod)(
const TRecord&, TAcquireReturn),
84 template <
typename T,
typename TAcquireReturn,
typename TProduceReturn,
typename TRecord,
typename TDecorator>
87 TProduceReturn (
T ::*iProduceMethod)(
const TRecord&, TAcquireReturn),
88 const TDecorator& iDec,
90 return setWhatAcquiredProducedWithLambda<TAcquireReturn, TProduceReturn, TRecord>(
92 return (iThis->*iAcquireMethod)(iRecord,
std::move(iHolder));
94 [iThis, iProduceMethod](TRecord
const& iRecord, TAcquireReturn iAcquireReturn) {
95 return (iThis->*iProduceMethod)(iRecord,
std::move(iAcquireReturn));
106 template <
typename TAcquireFunc,
typename TProduceFunc>
108 TProduceFunc&& produceFunc,
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>;
116 return setWhatAcquiredProducedWithLambda<TAcquireReturn, TProduceReturn, TRecord>(
117 std::forward<TAcquireFunc>(acquireFunc), std::forward<TProduceFunc>(produceFunc), DecoratorType(), iLabel);
122 template <
typename TAcquireReturn,
123 typename TProduceReturn,
125 typename TAcquireFunc,
126 typename TProduceFunc,
129 TProduceFunc&& produceFunc,
133 using DecoratorType = std::decay_t<TDecorator>;
141 unsigned int iovIndex = 0;
142 auto temp = std::make_shared<CallbackType>(
this,
143 std::forward<TAcquireFunc>(acquireFunc),
144 std::forward<TProduceFunc>(produceFunc),
146 std::forward<TDecorator>(iDec));
148 std::make_shared<std::pair<unsigned int, std::shared_ptr<CallbackType>>>(iovIndex,
std::move(
temp));
151 static_cast<const TRecord*>(
nullptr),
auto setWhatAcquiredProducedWithLambda(TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, const es::Label &iLabel={})
auto setWhatAcquiredProduced(T *iThis, const char *iLabel)
auto setWhatAcquiredProduced(T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
auto setWhatAcquiredProduced(T *iThis, const es::Label &iLabel={})
const TDecorator & createDecoratorFrom(T *, const TRecord *, const TDecorator &iDec)
ESConsumesInfo * consumesInfoPushBackNew()
auto setWhatAcquiredProduced(T *iThis, TAcquireReturn(T::*iAcquireMethod)(const TRecord &, WaitingTaskWithArenaHolder), TProduceReturn(T ::*iProduceMethod)(const TRecord &, TAcquireReturn), const TDecorator &iDec, const es::Label &iLabel={})
ESConsumesCollectorT< TRecord > setWhatAcquiredProducedWithLambda(TAcquireFunc &&acquireFunc, TProduceFunc &&produceFunc, TDecorator &&iDec, const es::Label &iLabel={})
void registerProducts(std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
auto setWhatAcquiredProduced(T *iThis, const std::string &iLabel)
unsigned int consumesInfoSize() const
auto setWhatAcquiredProduced(T *iThis, TAcquireReturn(T::*iAcquireMethod)(const TRecord &, WaitingTaskWithArenaHolder), TProduceReturn(T::*iProduceMethod)(const TRecord &, TAcquireReturn), const es::Label &iLabel={})