The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
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
 
virtual StatusCode release () const =0
 
const IAlgToolget () const
 
IAlgToolget ()
 
virtual std::string typeAndName () const =0
 
bool isEnabled () const
 Helper to check if the ToolHandle should be retrieved.
 
void enable ()
 
void disable ()
 
bool setEnabled (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 78 of file ToolHandle.h.

Constructor & Destructor Documentation

◆ BaseToolHandle()

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

Definition at line 81 of file ToolHandle.h.

bool createIf() const noexcept
Definition ToolHandle.h:51
const IInterface * parent() const noexcept
Definition ToolHandle.h:53
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition ToolHandle.h:43

Member Function Documentation

◆ disable()

void BaseToolHandle::disable ( )
inline

Definition at line 109 of file ToolHandle.h.

109{ m_enabled = false; }

◆ enable()

void BaseToolHandle::enable ( )
inline

Definition at line 107 of file ToolHandle.h.

107{ m_enabled = true; }

◆ get() [1/2]

IAlgTool * BaseToolHandle::get ( )
inline

Definition at line 96 of file ToolHandle.h.

96{ return getAsIAlgTool(); }
virtual const IAlgTool * getAsIAlgTool() const =0

◆ get() [2/2]

const IAlgTool * BaseToolHandle::get ( ) const
inline

Definition at line 94 of file ToolHandle.h.

94{ return getAsIAlgTool(); }

◆ getAsIAlgTool() [1/2]

◆ getAsIAlgTool() [2/2]

◆ i_retrieve()

◆ isEnabled()

bool BaseToolHandle::isEnabled ( ) const
inline

Helper to check if the ToolHandle should be retrieved.

Definition at line 101 of file ToolHandle.h.

101 {
102 // the handle is considered enabled if the type/name is valid and the
103 // enabled flag was set to true, or it was already retrieved
104 return ( m_enabled && !typeAndName().empty() ) || get();
105 }
const IAlgTool * get() const
Definition ToolHandle.h:94
virtual std::string typeAndName() const =0

◆ release()

◆ retrieve() [1/4]

◆ retrieve() [2/4]

◆ retrieve() [3/4]

◆ retrieve() [4/4]

StatusCode BaseToolHandle::retrieve ( IAlgTool *& tool) const
inline

Definition at line 86 of file ToolHandle.h.

86{ return i_retrieve( tool ); }
virtual StatusCode i_retrieve(IAlgTool *&) const =0

◆ setEnabled()

bool BaseToolHandle::setEnabled ( bool flag)
inline

Definition at line 111 of file ToolHandle.h.

111{ return std::exchange( m_enabled, flag ); }

◆ typeAndName()

Member Data Documentation

◆ m_enabled

bool BaseToolHandle::m_enabled = true
protected

Definition at line 118 of file ToolHandle.h.


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