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 (WaitingTask *iWaitTask, const EventSetupRecordImpl &iRecord, const DataKey &, EventSetupImpl const *iEventSetupImpl, ServiceToken const &iToken) 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 *) 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 (WaitingTask *, EventSetupRecordImpl const &, DataKey const &, EventSetupImpl const *, ServiceToken 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 38 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 42 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 40 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 41 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 44 of file CallbackProxy.h.

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

◆ ~CallbackProxy()

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

Definition at line 51 of file CallbackProxy.h.

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

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

67  {
68  data_ = DataT{};
69  callback_->newRecordComing();
70  }

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 ( WaitingTask ,
const EventSetupRecordImpl ,
const DataKey iKey,
EventSetupImpl const *  ,
ServiceToken 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 56 of file CallbackProxy.h.

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

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:77
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:78