CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator > Class Template Reference

#include <Callback.h>

Inheritance diagram for edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >:
edm::eventsetup::CallbackBase

Public Types

typedef TReturn(T::* method_type) (const TRecord &)
 

Public Member Functions

 Callback (T *iProd, method_type iMethod, const TDecorator &iDec=TDecorator())
 
template<class DataT >
void holdOntoPointer (DataT *iData)
 
void newRecordComing ()
 
void operator() (const TRecord &iRecord)
 
template<class RemainingContainerT , class DataT , class ProductsT >
void setData (ProductsT &iProducts, const RemainingContainerT *, const DataT *)
 
template<class DataT , class ProductsT >
void setData (ProductsT &iProducts, const produce::Null *, const DataT *)
 
void storeReturnedValues (TReturn iReturn)
 
- Public Member Functions inherited from edm::eventsetup::CallbackBase
virtual ~CallbackBase ()
 

Private Member Functions

 Callback (const Callback &)
 
const Callbackoperator= (const Callback &)
 

Private Attributes

TDecorator decorator_
 
method_type method_
 
edm::propagate_const< T * > producer_
 
std::vector< void * > proxyData_
 
bool wasCalledForThisRecord_
 

Detailed Description

template<typename T, typename TReturn, typename TRecord, typename TDecorator = CallbackSimpleDecorator<TRecord>>
class edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >

Definition at line 48 of file Callback.h.

Member Typedef Documentation

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
typedef TReturn(T ::* edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::method_type) (const TRecord &)

Definition at line 50 of file Callback.h.

Constructor & Destructor Documentation

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::Callback ( T iProd,
method_type  iMethod,
const TDecorator &  iDec = TDecorator() 
)
inline

Definition at line 52 of file Callback.h.

54  :
55  proxyData_(produce::size< TReturn >::value, static_cast<void*>(nullptr)),
56  producer_(iProd),
57  method_(iMethod),
59  decorator_(iDec) {}
std::vector< void * > proxyData_
Definition: Callback.h:112
edm::propagate_const< T * > producer_
Definition: Callback.h:113
template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::Callback ( const Callback< T, TReturn, TRecord, TDecorator > &  )
private

Member Function Documentation

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
template<class DataT >
void edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::holdOntoPointer ( DataT *  iData)
inline

Definition at line 79 of file Callback.h.

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
void edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::newRecordComing ( )
inline

Definition at line 103 of file Callback.h.

103  {
104  wasCalledForThisRecord_ = false;
105  }
template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
void edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::operator() ( const TRecord &  iRecord)
inline

Definition at line 69 of file Callback.h.

69  {
71  decorator_.pre(iRecord);
72  storeReturnedValues((producer_->*method_)(iRecord));
74  decorator_.post(iRecord);
75  }
76  }
void storeReturnedValues(TReturn iReturn)
Definition: Callback.h:83
edm::propagate_const< T * > producer_
Definition: Callback.h:113
template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
const Callback& edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::operator= ( const Callback< T, TReturn, TRecord, TDecorator > &  )
private
template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
template<class RemainingContainerT , class DataT , class ProductsT >
void edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::setData ( ProductsT &  iProducts,
const RemainingContainerT *  ,
const DataT *   
)
inline

Definition at line 90 of file Callback.h.

References edm::eventsetup::copyFromTo(), and groupFilesInBlocks::temp.

90  {
91  DataT* temp = reinterpret_cast< DataT*>(proxyData_[produce::find_index<TReturn,DataT>::value]) ;
92  if(0 != temp) { copyFromTo(iProducts, *temp); }
93  setData(iProducts, static_cast< const typename RemainingContainerT::head_type *>(nullptr),
94  static_cast< const typename RemainingContainerT::tail_type *>(nullptr));
95  }
void setData(ProductsT &iProducts, const RemainingContainerT *, const DataT *)
Definition: Callback.h:90
std::vector< void * > proxyData_
Definition: Callback.h:112
void copyFromTo(FromT &iFrom, ToT &iTo)
template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
template<class DataT , class ProductsT >
void edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::setData ( ProductsT &  iProducts,
const produce::Null ,
const DataT *   
)
inline

Definition at line 97 of file Callback.h.

References edm::eventsetup::copyFromTo(), and groupFilesInBlocks::temp.

97  {
98 
99  DataT* temp = reinterpret_cast< DataT*>(proxyData_[produce::find_index<TReturn,DataT>::value]) ;
100  //std::cout <<" setData["<< produce::find_index<TReturn,DataT>::value<<"] "<< temp <<std::endl;
101  if(0 != temp) { copyFromTo(iProducts, *temp); }
102  }
std::vector< void * > proxyData_
Definition: Callback.h:112
void copyFromTo(FromT &iFrom, ToT &iTo)
template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
void edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::storeReturnedValues ( TReturn  iReturn)
inline

Definition at line 83 of file Callback.h.

83  {
84  //std::cout <<" storeReturnedValues "<< iReturn <<" " <<iReturn->value_ <<std::endl;
86  setData(iReturn, static_cast<typename type::head_type*>(nullptr), static_cast<const typename type::tail_type *>(nullptr));
87  }
type
Definition: HCALResponse.h:21
void setData(ProductsT &iProducts, const RemainingContainerT *, const DataT *)
Definition: Callback.h:90

Member Data Documentation

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
TDecorator edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::decorator_
private

Definition at line 116 of file Callback.h.

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
method_type edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::method_
private

Definition at line 114 of file Callback.h.

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
edm::propagate_const<T*> edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::producer_
private

Definition at line 113 of file Callback.h.

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
std::vector<void*> edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::proxyData_
private

Definition at line 112 of file Callback.h.

template<typename T , typename TReturn , typename TRecord , typename TDecorator = CallbackSimpleDecorator<TRecord>>
bool edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::wasCalledForThisRecord_
private

Definition at line 115 of file Callback.h.