CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT > Class Template Reference

#include <CallbackProxy.h>

Inheritance diagram for edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >:
edm::eventsetup::DataProxy

Public Types

typedef RecordT record_type
 
typedef produce::smart_pointer_traits< DataT >::type value_type
 

Public Member Functions

 CallbackProxy (std::shared_ptr< CallbackT > &iCallback)
 
const void * getImpl (const EventSetupRecord &iRecord, const DataKey &)
 
void invalidateCache ()
 
virtual ~CallbackProxy ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxy
bool cacheIsValid () const
 
 DataProxy ()
 
void doGet (EventSetupRecord const &iRecord, DataKey const &iKey, bool iTransiently) const
 
void const * get (EventSetupRecord const &, DataKey const &iKey, bool iTransiently) const
 
void invalidate ()
 
ComponentDescription const * providerDescription () const
 returns the description of the DataProxyProvider which owns this Proxy More...
 
void resetIfTransient ()
 
void setProviderDescription (ComponentDescription const *iDesc)
 
virtual ~DataProxy ()
 

Private Member Functions

 CallbackProxy (const CallbackProxy &)
 
const CallbackProxyoperator= (const CallbackProxy &)
 

Private Attributes

edm::propagate_const< std::shared_ptr< CallbackT > > callback_
 
DataT data_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::eventsetup::DataProxy
void clearCacheIsValid ()
 
virtual void const * getImpl (EventSetupRecord const &, DataKey const &iKey)=0
 
virtual void invalidateTransientCache ()
 

Detailed Description

template<class CallbackT, class RecordT, class DataT>
class edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >

Definition at line 38 of file CallbackProxy.h.

Member Typedef Documentation

template<class CallbackT , class RecordT , class DataT >
typedef RecordT edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::record_type

Definition at line 42 of file CallbackProxy.h.

template<class CallbackT , class RecordT , class DataT >
typedef produce::smart_pointer_traits<DataT>::type edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::value_type

Definition at line 41 of file CallbackProxy.h.

Constructor & Destructor Documentation

template<class CallbackT , class RecordT , class DataT >
edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::CallbackProxy ( std::shared_ptr< CallbackT > &  iCallback)
inline

Definition at line 44 of file CallbackProxy.h.

References edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::data_.

Referenced by edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::invalidateCache().

44  :
45  data_(),
46  callback_(iCallback) {
47  //The callback fills the data directly. This is done so that the callback does not have to
48  // hold onto a temporary copy of the result of the callback since the callback is allowed
49  // to return multiple items where only one item is needed by this Proxy
50  iCallback->holdOntoPointer(&data_) ; }
edm::propagate_const< std::shared_ptr< CallbackT > > callback_
Definition: CallbackProxy.h:77
template<class CallbackT , class RecordT , class DataT >
virtual edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::~CallbackProxy ( )
inlinevirtual

Definition at line 51 of file CallbackProxy.h.

References edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::callback_.

51  {
52  DataT* dummy(nullptr);
53  callback_->holdOntoPointer(dummy) ;
54  }
edm::propagate_const< std::shared_ptr< CallbackT > > callback_
Definition: CallbackProxy.h:77
template<class CallbackT , class RecordT , class DataT >
edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::CallbackProxy ( const CallbackProxy< CallbackT, RecordT, DataT > &  )
private

Member Function Documentation

template<class CallbackT , class RecordT , class DataT >
const void* edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::getImpl ( const EventSetupRecord iRecord,
const DataKey  
)
inline

Definition at line 60 of file CallbackProxy.h.

References edm::eventsetup::EventSetupRecord::key().

60  {
61  assert(iRecord.key() == RecordT::keyForClass());
62  (*callback_)(static_cast<const record_type&>(iRecord));
63  return &(*data_);
64  }
template<class CallbackT , class RecordT , class DataT >
void edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::invalidateCache ( )
inlinevirtual

indicates that the Proxy should invalidate any cached information as that information has 'expired' (i.e. we have moved to a new IOV)

Implements edm::eventsetup::DataProxy.

Definition at line 66 of file CallbackProxy.h.

References edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::callback_, edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::CallbackProxy(), edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::data_, and edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::operator=().

66  {
67  data_ = DataT();
68  callback_->newRecordComing();
69  }
edm::propagate_const< std::shared_ptr< CallbackT > > callback_
Definition: CallbackProxy.h:77
template<class CallbackT , class RecordT , class DataT >
const CallbackProxy& edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::operator= ( const CallbackProxy< CallbackT, RecordT, DataT > &  )
private

Member Data Documentation

template<class CallbackT , class RecordT , class DataT >
edm::propagate_const<std::shared_ptr<CallbackT> > edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::callback_
private
template<class CallbackT , class RecordT , class DataT >
DataT edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::data_
private