CMS 3D CMS Logo

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

List of all members.

Public Types

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

Public Member Functions

 CallbackProxy (boost::shared_ptr< CallbackT > &iCallback)
const void * getImpl (const EventSetupRecord &iRecord, const DataKey &)
void invalidateCache ()
virtual ~CallbackProxy ()

Private Member Functions

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

Private Attributes

boost::shared_ptr< CallbackT > callback_
DataT data_

Detailed Description

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

Definition at line 37 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 41 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 40 of file CallbackProxy.h.


Constructor & Destructor Documentation

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

Definition at line 43 of file CallbackProxy.h.

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

                                                              :
         data_(),
         callback_(iCallback) { 
            //The callback fills the data directly.  This is done so that the callback does not have to
            //  hold onto a temporary copy of the result of the callback since the callback is allowed
            //  to return multiple items where only one item is needed by this Proxy
            iCallback->holdOntoPointer(&data_) ; }
template<class CallbackT , class RecordT , class DataT >
virtual edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::~CallbackProxy ( ) [inline, virtual]

Definition at line 50 of file CallbackProxy.h.

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

                                  {
            DataT* dummy(0);
            callback_->holdOntoPointer(dummy) ;
         }
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 ,
const DataKey iKey 
) [inline, virtual]

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

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

                                                                              {
            assert(iRecord.key() == RecordT::keyForClass());
            (*callback_)(static_cast<const record_type&>(iRecord));
            return &(*data_);
         }
template<class CallbackT , class RecordT , class DataT >
void edm::eventsetup::CallbackProxy< CallbackT, RecordT, DataT >::invalidateCache ( ) [inline, virtual]

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

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

                                {
            data_ = DataT();
            callback_->newRecordComing();
         }
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 >
boost::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]