CMS 3D CMS Logo

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

#include <CallbackProxy.h>

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

Public Types

using RecordType = RecordT
 
using smart_pointer_traits = produce::smart_pointer_traits< DataT >
 
using ValueType = typename smart_pointer_traits::type
 

Public Member Functions

 CallbackProxy (const CallbackProxy &)=delete
 
 CallbackProxy (std::shared_ptr< CallbackT > &iCallback)
 
void const * getAfterPrefetchImpl () const final
 
void invalidateCache () override
 
const CallbackProxyoperator= (const CallbackProxy &)=delete
 
void prefetchAsyncImpl (WaitingTaskHolder iWaitTask, const EventSetupRecordImpl &iRecord, const DataKey &, EventSetupImpl const *iEventSetupImpl, ServiceToken const &iToken, edm::ESParentContext const &iParent) final
 
 ~CallbackProxy () final
 
- Public Member Functions inherited from edm::eventsetup::DataProxy
bool cacheIsValid () const
 
 DataProxy ()
 
 DataProxy (DataProxy const &)=delete
 
void const * get (EventSetupRecordImpl const &, DataKey const &, bool iTransiently, ActivityRegistry const *, EventSetupImpl const *, ESParentContext const &) const
 
void const * getAfterPrefetch (const EventSetupRecordImpl &iRecord, const DataKey &iKey, bool iTransiently) const
 
virtual void initializeForNewIOV ()
 
void invalidate ()
 
DataProxy const & operator= (DataProxy const &)=delete
 
void prefetchAsync (WaitingTaskHolder, EventSetupRecordImpl const &, DataKey const &, EventSetupImpl const *, ServiceToken const &, ESParentContext const &) const
 
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 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 invalidateTransientCache ()
 

Detailed Description

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

Definition at line 39 of file CallbackProxy.h.

Member Typedef Documentation

◆ RecordType

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

Definition at line 43 of file CallbackProxy.h.

◆ smart_pointer_traits

template<class CallbackT , class RecordT , class DataT >
using edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::smart_pointer_traits = produce::smart_pointer_traits<DataT>

Definition at line 41 of file CallbackProxy.h.

◆ ValueType

template<class CallbackT , class RecordT , class DataT >
using edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::ValueType = typename smart_pointer_traits::type

Definition at line 42 of file CallbackProxy.h.

Constructor & Destructor Documentation

◆ CallbackProxy() [1/2]

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

Definition at line 45 of file CallbackProxy.h.

45  : callback_{iCallback} {
46  //The callback fills the data directly. This is done so that the callback does not have to
47  // hold onto a temporary copy of the result of the callback since the callback is allowed
48  // to return multiple items where only one item is needed by this Proxy
49  iCallback->holdOntoPointer(&data_);
50  }

◆ ~CallbackProxy()

template<class CallbackT , class RecordT , class DataT >
edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::~CallbackProxy ( )
inlinefinal

Definition at line 52 of file CallbackProxy.h.

52  {
53  DataT* dummy(nullptr);
54  callback_->holdOntoPointer(dummy);
55  }

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

◆ CallbackProxy() [2/2]

template<class CallbackT , class RecordT , class DataT >
edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::CallbackProxy ( const CallbackProxy< CallbackT, RecordT, DataT > &  )
delete

Member Function Documentation

◆ getAfterPrefetchImpl()

template<class CallbackT , class RecordT , class DataT >
void const* edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::getAfterPrefetchImpl ( ) const
inlinefinalvirtual

used to retrieve the data from the implementation. The data is then cached locally.

Implements edm::eventsetup::DataProxy.

Definition at line 67 of file CallbackProxy.h.

References edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::data_, and edm::eventsetup::produce::smart_pointer_traits< T >::getPointer().

◆ invalidateCache()

template<class CallbackT , class RecordT , class DataT >
void edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::invalidateCache ( )
inlineoverridevirtual

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 69 of file CallbackProxy.h.

69  {
70  data_ = DataT{};
71  callback_->newRecordComing();
72  }

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

◆ operator=()

template<class CallbackT , class RecordT , class DataT >
const CallbackProxy& edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::operator= ( const CallbackProxy< CallbackT, RecordT, DataT > &  )
delete

◆ prefetchAsyncImpl()

template<class CallbackT , class RecordT , class DataT >
void edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::prefetchAsyncImpl ( WaitingTaskHolder  ,
const EventSetupRecordImpl ,
const DataKey iKey,
EventSetupImpl const *  ,
ServiceToken const &  ,
edm::ESParentContext const &   
)
inlinefinalvirtual

This is the function which does the real work of getting the data if it is not already cached. The returning 'void const*' must point to an instance of the class type corresponding to the type designated in iKey. So if iKey refers to a base class interface the pointer must be a pointer to that base class interface and not a pointer to an inheriting class instance.

Implements edm::eventsetup::DataProxy.

Definition at line 57 of file CallbackProxy.h.

62  {
63  assert(iRecord.key() == RecordT::keyForClass());
64  callback_->prefetchAsync(iWaitTask, &iRecord, iEventSetupImpl, iToken, iParent);
65  }

References cms::cuda::assert(), and edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::callback_.

Member Data Documentation

◆ callback_

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

◆ data_

template<class CallbackT , class RecordT , class DataT >
DataT edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::data_ {}
private
edm::eventsetup::CallbackProxy::data_
DataT data_
Definition: CallbackProxy.h:79
cms::cuda::assert
assert(be >=bs)
edm::eventsetup::produce::smart_pointer_traits::getPointer
static auto getPointer(T const &iPtr) -> decltype(&*iPtr)
Definition: produce_helpers.h:90
dummy
Definition: DummySelector.h:38
edm::eventsetup::CallbackProxy::callback_
edm::propagate_const< std::shared_ptr< CallbackT > > callback_
Definition: CallbackProxy.h:80