The Gaudi Framework  v30r3 (a5ef0a68)
BaseToolHandle Class Referenceabstract

Non-templated base class for actual ToolHandle<T>. More...

#include <GaudiKernel/ToolHandle.h>

Inheritance diagram for BaseToolHandle:
Collaboration diagram for BaseToolHandle:

Public Member Functions

StatusCode retrieve (IAlgTool *&tool) const
 
virtual StatusCode retrieve () const =0
 
virtual StatusCode retrieve (DisableTool sd)=0
 
virtual StatusCode retrieve (EnableTool sd)=0
 
const IAlgToolget () const
 
IAlgToolget ()
 
virtual std::string typeAndName () const =0
 
bool isEnabled () const
 Helper to check if the ToolHandle should be retrieved. More...
 
void enable ()
 
void disable ()
 
bool setEnabled (const bool flag)
 
- Public Member Functions inherited from ToolHandleInfo
virtual ~ToolHandleInfo ()=default
 
bool isPublic () const noexcept
 
bool createIf () const noexcept
 
const IInterfaceparent () const noexcept
 

Protected Member Functions

 BaseToolHandle (const IInterface *parent=nullptr, bool createIf=true)
 
virtual StatusCode i_retrieve (IAlgTool *&) const =0
 
virtual const IAlgToolgetAsIAlgTool () const =0
 
virtual IAlgToolgetAsIAlgTool ()=0
 
- Protected Member Functions inherited from ToolHandleInfo
 ToolHandleInfo (const IInterface *parent=nullptr, bool createIf=true)
 

Protected Attributes

bool m_enabled = true
 
- Protected Attributes inherited from ToolHandleInfo
const IInterfacem_parent = nullptr
 
bool m_createIf {true}
 

Additional Inherited Members

- Static Public Member Functions inherited from ToolHandleInfo
static std::string toolComponentType (const IInterface *parent)
 
static std::string toolParentName (const IInterface *parent)
 

Detailed Description

Non-templated base class for actual ToolHandle<T>.

Defines the interface for the management of ToolHandles in the Algorithms and Tools

Author
Daniel Funke danie.nosp@m.l.fu.nosp@m.nke@c.nosp@m.ern..nosp@m.ch

Definition at line 71 of file ToolHandle.h.

Constructor & Destructor Documentation

BaseToolHandle::BaseToolHandle ( const IInterface parent = nullptr,
bool  createIf = true 
)
inlineprotected

Definition at line 75 of file ToolHandle.h.

75 : ToolHandleInfo( parent, createIf ) {}
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:33
bool createIf() const noexcept
Definition: ToolHandle.h:43

Member Function Documentation

void BaseToolHandle::disable ( )
inline

Definition at line 102 of file ToolHandle.h.

102 { m_enabled = false; }
void BaseToolHandle::enable ( )
inline

Definition at line 100 of file ToolHandle.h.

100 { m_enabled = true; }
const IAlgTool* BaseToolHandle::get ( ) const
inline

Definition at line 86 of file ToolHandle.h.

86 { return getAsIAlgTool(); }
virtual const IAlgTool * getAsIAlgTool() const =0
IAlgTool* BaseToolHandle::get ( )
inline

Definition at line 88 of file ToolHandle.h.

88 { return getAsIAlgTool(); }
virtual const IAlgTool * getAsIAlgTool() const =0
virtual const IAlgTool* BaseToolHandle::getAsIAlgTool ( ) const
protectedpure virtual
virtual IAlgTool* BaseToolHandle::getAsIAlgTool ( )
protectedpure virtual
virtual StatusCode BaseToolHandle::i_retrieve ( IAlgTool *&  ) const
protectedpure virtual
bool BaseToolHandle::isEnabled ( ) const
inline

Helper to check if the ToolHandle should be retrieved.

Definition at line 93 of file ToolHandle.h.

94  {
95  // the handle is considered enabled if the type/name is valid and the
96  // enabled flag was set to true, or it was already retrieved
97  return ( m_enabled && !typeAndName().empty() ) || get();
98  }
virtual std::string typeAndName() const =0
StatusCode BaseToolHandle::retrieve ( IAlgTool *&  tool) const
inline

Definition at line 80 of file ToolHandle.h.

80 { return i_retrieve( tool ); }
virtual StatusCode i_retrieve(IAlgTool *&) const =0
virtual StatusCode BaseToolHandle::retrieve ( ) const
pure virtual
virtual StatusCode BaseToolHandle::retrieve ( DisableTool  sd)
pure virtual
virtual StatusCode BaseToolHandle::retrieve ( EnableTool  sd)
pure virtual
bool BaseToolHandle::setEnabled ( const bool  flag)
inline

Definition at line 104 of file ToolHandle.h.

105  {
106  auto old = m_enabled;
107  m_enabled = flag;
108  return old;
109  }
virtual std::string BaseToolHandle::typeAndName ( ) const
pure virtual

Member Data Documentation

bool BaseToolHandle::m_enabled = true
protected

Definition at line 116 of file ToolHandle.h.


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