ATLAS Offline Software
Loading...
Searching...
No Matches
ReadHandle< T > Class Reference

a smart pointer to an object of a given type in an IProxyDict (such as StoreGateSvc). 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");
}
StatusCode MyAlg::execute()
{
ATH_MSG_INFO("int value @[" << m_int.name() << "]="
<< *m_int);
return StatusCode::SUCCESS;
}
#define ATH_MSG_INFO(x)
Base class from which all concrete Athena algorithm classes should be derived.

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


The documentation for this class was generated from the following file: