ATLAS Offline Software
Public Member Functions | List of all members
D3PD::IObjGetterTool Class Referenceabstract

Abstract interface to get an object to put in the tuple. More...

#include <IObjGetterTool.h>

Inheritance diagram for D3PD::IObjGetterTool:
Collaboration diagram for D3PD::IObjGetterTool:

Public Member Functions

 DeclareInterfaceID (IObjGetterTool, 1, 0)
 Gaudi interface definition. More...
 
virtual const std::type_info & typeinfo () const =0
 Return the type of object retrieved by this tool. More...
 
virtual const void * getUntyped (bool allowMissing=false)=0
 Return the target object. More...
 
template<class T >
const T * get (bool allowMissing=false)
 Type-safe wrapper for get. More...
 
virtual void releaseObjectUntyped (const void *p)
 Release an object retrieved from the getter. More...
 
template<class T >
void releaseObject (const T *p)
 Type-safe wrapper for releaseObjectUntyped. More...
 
template<class T >
StatusCode configureD3PD ()
 Test type compatibility. More...
 
virtual const void * getTypeinfo (const std::type_info &ti, bool allowMissing=false)=0
 Return the target object cast to a different pointer type. More...
 
void releaseObjectTypeinfo (const void *p, const std::type_info &ti)
 Release an object retrieved from the getter. More...
 
virtual StatusCode configureTypeinfo (const std::type_info &ti)=0
 Test type compatibility. More...
 

Detailed Description

Abstract interface to get an object to put in the tuple.

The input to an object filler tool is provided by a tool of type IObjGetterTool. This will return an object or an object container of a given type. It is expected that the usual case for this will be to fetch an object from StoreGate; generic code will be provided for this case and for the case of retrieving the results of a particle selection algorithm. Other tools can be defined for specific special cases, such as using selections stored in a top inputs object, or for performing additional selections.

User-defined getters generally shouldn't implement this interface directly, but instead use the type-safe wrappers provided by ObjGetterTool.

Once you're done with the object, you should call releaseObject(). This will usually be a no-op, but it allows the getter to return a dynamically-allocated object.

Definition at line 45 of file IObjGetterTool.h.

Member Function Documentation

◆ configureD3PD()

template<class T >
StatusCode D3PD::IObjGetterTool::configureD3PD ( )

Test type compatibility.

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.

This is implemented in terms of configureTypeinfo.

◆ configureTypeinfo()

virtual StatusCode D3PD::IObjGetterTool::configureTypeinfo ( const std::type_info &  ti)
pure virtual

Test type compatibility.

Parameters
tiThe 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.

◆ DeclareInterfaceID()

D3PD::IObjGetterTool::DeclareInterfaceID ( IObjGetterTool  ,
,
 
)

Gaudi interface definition.

◆ get()

template<class T >
const T* D3PD::IObjGetterTool::get ( bool  allowMissing = false)

Type-safe wrapper for get.

Parameters
allowMissingIf 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().

◆ getTypeinfo()

virtual const void* D3PD::IObjGetterTool::getTypeinfo ( const std::type_info &  ti,
bool  allowMissing = false 
)
pure virtual

Return the target object cast to a different pointer type.

Parameters
tiThe desired type.
allowMissingIf 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.

◆ getUntyped()

virtual const void* D3PD::IObjGetterTool::getUntyped ( bool  allowMissing = false)
pure virtual

◆ releaseObject()

template<class T >
void D3PD::IObjGetterTool::releaseObject ( const T *  p)

Type-safe wrapper for releaseObjectUntyped.

Parameters
pThe 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().

◆ releaseObjectTypeinfo()

void D3PD::IObjGetterTool::releaseObjectTypeinfo ( const void *  p,
const std::type_info &  ti 
)

Release an object retrieved from the getter.

Parameters
pThe object to release.
tiThe 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.

◆ releaseObjectUntyped()

virtual void D3PD::IObjGetterTool::releaseObjectUntyped ( const void *  p)
virtual

Release an object retrieved from the getter.

Parameters
pThe 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.

◆ typeinfo()

virtual const std::type_info& D3PD::IObjGetterTool::typeinfo ( ) const
pure virtual

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