1 #ifndef Framework_Callback_h 2 #define Framework_Callback_h 29 namespace eventsetup {
37 template<
typename TRecord>
39 void pre(
const TRecord&) {}
40 void post(
const TRecord&) {}
50 typedef TReturn (
T ::* method_type)(
const TRecord&);
54 const TDecorator& iDec = TDecorator()) :
58 wasCalledForThisRecord_(
false),
70 if(!wasCalledForThisRecord_) {
71 decorator_.pre(iRecord);
72 storeReturnedValues((producer_->*method_)(iRecord));
73 wasCalledForThisRecord_ =
true;
74 decorator_.post(iRecord);
86 setData(iReturn, static_cast<typename type::head_type*>(
nullptr), static_cast<const typename type::tail_type *>(
nullptr));
89 template<
class RemainingContainerT,
class DataT,
class ProductsT>
90 void setData(ProductsT& iProducts,
const RemainingContainerT*,
const DataT*) {
92 if(
nullptr != temp) {
copyFromTo(iProducts, *temp); }
93 setData(iProducts, static_cast< const typename RemainingContainerT::head_type *>(
nullptr),
94 static_cast< const typename RemainingContainerT::tail_type *>(
nullptr));
96 template<
class DataT,
class ProductsT>
101 if(
nullptr != temp) {
copyFromTo(iProducts, *temp); }
104 wasCalledForThisRecord_ =
false;
void storeReturnedValues(TReturn iReturn)
void setData(ProductsT &iProducts, const RemainingContainerT *, const DataT *)
void holdOntoPointer(DataT *iData)
std::vector< void * > proxyData_
void pre(const TRecord &)
void setData(ProductsT &iProducts, const produce::Null *, const DataT *)
Callback(T *iProd, method_type iMethod, const TDecorator &iDec=TDecorator())
void post(const TRecord &)
void operator()(const TRecord &iRecord)
bool wasCalledForThisRecord_
void copyFromTo(FromT &iFrom, ToT &iTo)
edm::propagate_const< T * > producer_