![]() |
ATLAS Offline Software
|
Getter tool to retrieve single objects from StoreGate. More...
#include <SGObjGetterTool.h>
Public Member Functions | |
| SGObjGetterTool (const std::string &type, const std::string &name, const IInterface *parent) | |
| Standard Gaudi tool constructor. | |
| virtual StatusCode | initialize () |
Standard Gaudi initialize method. | |
| virtual const std::type_info & | typeinfo () const |
| Return the type of object retrieved by this tool. | |
| CLID | clid () const |
| Return the class ID being read by this tool. | |
| virtual const void * | getUntyped (bool allowMissing=false) |
| Return the target object. | |
| virtual const void * | getTypeinfo (const std::type_info &ti, bool allowMissing=false) |
| Return the target object cast to a different pointer type. | |
| virtual StatusCode | configureTypeinfo (const std::type_info &ti) |
| Test type compatibility. | |
| void | releaseObjectTypeinfo (const void *p, const std::type_info &ti) |
| Release an object retrieved from the getter. | |
| DeclareInterfaceID (IObjGetterTool, 1, 0) | |
| Gaudi interface definition. | |
| template<class T> | |
| const T * | get (bool allowMissing=false) |
Type-safe wrapper for get. | |
| virtual void | releaseObjectUntyped (const void *p) |
| Release an object retrieved from the getter. | |
| template<class T> | |
| void | releaseObject (const T *p) |
Type-safe wrapper for releaseObjectUntyped. | |
| template<class T> | |
| StatusCode | configureD3PD () |
| Test type compatibility. | |
| virtual const void * | getTypeinfo (const std::type_info &ti, bool allowMissing=false)=0 |
| Return the target object cast to a different pointer type. | |
| void | releaseObjectTypeinfo (const void *p, const std::type_info &ti) |
| Release an object retrieved from the getter. | |
| virtual StatusCode | configureTypeinfo (const std::type_info &ti)=0 |
| Test type compatibility. | |
Protected Member Functions | |
| StatusCode | initializeImpl () |
| Initialize this mixin class. | |
Protected Attributes | |
| std::string | m_typename |
| Property: Name of the type of the object being retrieved. | |
| std::string | m_sgkey |
| Property: StoreGate key of the object being retrieved. | |
| ServiceHandle< IClassIDSvc > | m_clidsvc |
| Property: Instance of the ClassIDSvc to use. | |
| SGKeyResolver | m_resolver |
| Helper: Resolve the SG key to use. | |
Private Attributes | |
| CLID | m_clid |
| CLID for the object being retrieved. | |
| ServiceHandle< StoreGateSvc > & | m_sg |
| The event storage service. | |
| TypeConverter | m_converter |
| Helper to convert pointers. | |
| TypeConverter | m_backConverter |
Helper to convert pointers back, for releaseObject. | |
Getter tool to retrieve single objects from StoreGate.
This is a Getter tool that retrieves a single object from StoreGate, given the type name and SG key. This class should be able to handle any type that can be put into StoreGate.
Properties: TypeName - Name of the type of the object being retrieved. SGKey - StoreGate key of the object being retrieved. Can also be a comma or space-separated list. In that case, the first key that actually exists in the data store will be used. ClassIDSvc - ClassIDSvc instance to use.
Definition at line 46 of file SGObjGetterTool.h.
| D3PD::SGObjGetterTool::SGObjGetterTool | ( | const std::string & | type, |
| const std::string & | name, | ||
| const IInterface * | parent ) |
Standard Gaudi tool constructor.
| type | The name of the tool type. |
| name | The tool name. |
| parent | The tool's Gaudi parent. |
Definition at line 28 of file SGObjGetterTool.cxx.
|
inherited |
Return the class ID being read by this tool.
Definition at line 54 of file SGGetterImpl.cxx.
|
inherited |
|
pure virtualinherited |
|
virtualinherited |
Test type compatibility.
| ti | The desired type. |
Test to see if the object being returned by the tool can be converted to a pointer to T. This can be used to perform type checks during job initialization.
Definition at line 124 of file ObjGetterToolImpl.cxx.
|
inherited |
Gaudi interface definition.
|
inherited |
Type-safe wrapper for get.
| allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return the object as a pointer to T. Return 0 if the get fails or if the pointer can't be converted.
This is implemented in terms of getTypeinfo().
|
pure virtualinherited |
Return the target object cast to a different pointer type.
| ti | The desired type. |
| allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return the object as a pointer to the ti type. Return 0 if the get fails or if the pointer can't be converted.
|
virtualinherited |
Return the target object cast to a different pointer type.
| ti | The desired type. |
| allowMissing | If true, then we should not generate errors if the requested object is missing. |
Return the object as a pointer to the ti type. Return 0 if the get fails or if the pointer can't be converted.
Definition at line 45 of file ObjGetterToolImpl.cxx.
|
virtualinherited |
Return the target object.
| allowMissing | If true, then we should not generate errors if the requested object is missing. |
Should be of the type given by typeinfo. Return 0 on failure.
Implements D3PD::IObjGetterTool.
Reimplemented in D3PD::SGCollectionGetterTool< CONT >, D3PD::SGCollectionGetterTool< CaloCalibrationHitContainer >, D3PD::SGCollectionGetterTool< INav4MomLinkContainer >, D3PD::SGCollectionGetterTool< IParticleLinks >, D3PD::SGCollectionGetterTool< LArHitContainer >, D3PD::SGCollectionGetterTool< LArRawChannelContainer >, D3PD::SGCollectionGetterTool< Obj4Container >, D3PD::SGCollectionGetterTool< TileDigitsContainer >, D3PD::SGCollectionGetterTool< TileHitVector >, D3PD::SGCollectionGetterTool< TileRawChannelContainer >, and D3PD::SGCollectionGetterTool< TrackRecordCollection >.
Definition at line 68 of file SGGetterImpl.cxx.
|
virtual |
Standard Gaudi initialize method.
Definition at line 41 of file SGObjGetterTool.cxx.
|
protectedinherited |
Initialize this mixin class.
Call this from initialize.
Definition at line 105 of file SGGetterImpl.cxx.
|
inherited |
Type-safe wrapper for releaseObjectUntyped.
| p | The object to release. |
Call this when you are done with the object returned by get(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
This is implemented in terms of releaseObjectTypeinfo().
|
inherited |
Release an object retrieved from the getter.
| p | The object to release. |
| ti | The type of p. |
Call this when you are done with the object returned by getUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
|
inherited |
Release an object retrieved from the getter.
| p | The object to release. |
| ti | The type of p. |
Call this when you are done with the object returned by getUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
Definition at line 82 of file ObjGetterToolImpl.cxx.
|
virtualinherited |
Release an object retrieved from the getter.
| p | The object to release. |
Call this when you are done with the object returned by getUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.
|
virtualinherited |
Return the type of object retrieved by this tool.
Implements D3PD::IObjGetterTool.
Reimplemented in D3PD::SGCollectionGetterTool< CONT >, D3PD::SGCollectionGetterTool< CaloCalibrationHitContainer >, D3PD::SGCollectionGetterTool< INav4MomLinkContainer >, D3PD::SGCollectionGetterTool< IParticleLinks >, D3PD::SGCollectionGetterTool< LArHitContainer >, D3PD::SGCollectionGetterTool< LArRawChannelContainer >, D3PD::SGCollectionGetterTool< Obj4Container >, D3PD::SGCollectionGetterTool< TileDigitsContainer >, D3PD::SGCollectionGetterTool< TileHitVector >, D3PD::SGCollectionGetterTool< TileRawChannelContainer >, D3PD::SGCollectionGetterTool< TrackRecordCollection >, D3PD::SGTileDigitsGetterTool, D3PD::SGTileHitGetterTool, D3PD::SGTileModuleBitsGetterTool, and D3PD::SGTileRawChannelGetterTool.
Definition at line 39 of file SGGetterImpl.cxx.
|
privateinherited |
Helper to convert pointers back, for releaseObject.
Definition at line 97 of file ObjGetterToolImpl.h.
|
privateinherited |
CLID for the object being retrieved.
Definition at line 126 of file SGGetterImpl.h.
|
protectedinherited |
Property: Instance of the ClassIDSvc to use.
Definition at line 119 of file SGGetterImpl.h.
|
privateinherited |
Helper to convert pointers.
Definition at line 94 of file ObjGetterToolImpl.h.
|
protectedinherited |
Helper: Resolve the SG key to use.
Definition at line 122 of file SGGetterImpl.h.
|
privateinherited |
The event storage service.
Definition at line 129 of file SGGetterImpl.h.
|
protectedinherited |
Property: StoreGate key of the object being retrieved.
Definition at line 116 of file SGGetterImpl.h.
|
protectedinherited |
Property: Name of the type of the object being retrieved.
Definition at line 113 of file SGGetterImpl.h.