1 #ifndef Framework_Callback_h 2 #define Framework_Callback_h 23 #include <type_traits> 30 namespace eventsetup {
38 template<
typename TRecord>
40 void pre(
const TRecord&) {}
41 void post(
const TRecord&) {}
55 const TDecorator& iDec = TDecorator()) :
59 wasCalledForThisRecord_(
false),
71 if(!wasCalledForThisRecord_) {
72 decorator_.pre(iRecord);
73 storeReturnedValues((producer_->*method_)(iRecord));
74 wasCalledForThisRecord_ =
true;
75 decorator_.post(iRecord);
87 setData<typename type::head_type, typename type::tail_type>(iReturn);
90 template<
class RemainingContainerT,
class DataT,
class ProductsT>
93 if(
nullptr != temp) {
moveFromTo(iProducts, *temp); }
94 if constexpr( not std::is_same_v<produce::Null,RemainingContainerT> ) {
95 setData<
typename RemainingContainerT::head_type,
96 typename RemainingContainerT::tail_type>(iProducts);
100 wasCalledForThisRecord_ =
false;
void storeReturnedValues(TReturn iReturn)
void holdOntoPointer(DataT *iData)
void pre(const TRecord &)
TReturn(T::*)(const TRecord &) method_type
std::array< void *, produce::size< TReturn >::value > proxyData_
void moveFromTo(FromT &iFrom, ToT &iTo)
Callback(T *iProd, method_type iMethod, const TDecorator &iDec=TDecorator())
void post(const TRecord &)
void operator()(const TRecord &iRecord)
bool wasCalledForThisRecord_
void setData(ProductsT &iProducts)
edm::propagate_const< T * > producer_