ATLAS Offline Software
ReadHandle< T > Class Reference

a smart pointer to an object of a given type in an IProxyDict (such as StoreGateSvc). It d-casts and caches locally the pointed-at object, to speed-up subsequent accesses. It can be reset by the store for asynchronous updates (IOVSvc) More...

#include <ReadHandle.h>

Inheritance diagram for ReadHandle< T >:
Collaboration diagram for ReadHandle< T >:

Detailed Description

a smart pointer to an object of a given type in an IProxyDict (such as StoreGateSvc). It d-casts and caches locally the pointed-at object, to speed-up subsequent accesses. It can be reset by the store for asynchronous updates (IOVSvc)

SG::ReadHandle<T> can access const and non-const proxies in StoreGate but cannot modify them (i.e.: it is actually a const T*). A valid proxy must already exist in StoreGate.

Usage example:

class MyAlg : public AthAlgorithm
{
};
MyAlg::MyAlg(...) : ..., m_int("MyIntSgKey") {
declareProperty("IntHandle",
m_int = SG::ReadHandle<int>("MyIntSgKey"),
"a handle to an int in StoreGate");
}
{
ATH_MSG_INFO("int value @[" << m_int.name() << "]="
<< *m_int);
return StatusCode::SUCCESS;
}

For more information have a look under the package Control/AthenaExamples/AthExHelloWorld


The documentation for this class was generated from the following file:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArG4FSStartPointFilterLegacy.execute
execute
Definition: LArG4FSStartPointFilterLegacy.py:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgorithm
Definition: AthAlgorithm.h:47