| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BaseToolHandle Class Referenceabstract

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

`#include <GaudiKernel/ToolHandle.h>`

Inheritance diagram for BaseToolHandle:
[legend]
Collaboration diagram for BaseToolHandle:
[legend]

## 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 IAlgTool * | get () const
IAlgTool * | get ()
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 IInterface * | parent () const noexcept

## Protected Member Functions
| BaseToolHandle (const IInterface *parent=nullptr, bool createIf=true)
virtual StatusCode | i_retrieve (IAlgTool *&) const =0
virtual const IAlgTool * | getAsIAlgTool () const =0
virtual IAlgTool * | getAsIAlgTool ()=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 IInterface * | m_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 69 of file ToolHandle.h.

## Constructor & Destructor Documentation

## ◆ BaseToolHandle()

BaseToolHandle::BaseToolHandle | ( | const IInterface * | parent = `nullptr`,
|  | bool | createIf = `true`
| ) |  |
| inline protected

Definition at line 72 of file ToolHandle.h.

72 : ToolHandleInfo( parent, createIf ) {}
ToolHandleInfo::createIf
bool createIf() const noexcept
Definition: ToolHandle.h:42
ToolHandleInfo::parent
const IInterface * parent() const noexcept
Definition: ToolHandle.h:44
ToolHandleInfo::ToolHandleInfo
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:34

## Member Function Documentation

## ◆ disable()

void BaseToolHandle::disable | ( |  | ) |
| inline

Definition at line 98 of file ToolHandle.h.

98 { m_enabled = false; }
BaseToolHandle::m_enabled
bool m_enabled
Definition: ToolHandle.h:111

## ◆ enable()

void BaseToolHandle::enable | ( |  | ) |
| inline

Definition at line 96 of file ToolHandle.h.

96 { m_enabled = true; }
BaseToolHandle::m_enabled
bool m_enabled
Definition: ToolHandle.h:111

## ◆ get() [1/2]

const IAlgTool* BaseToolHandle::get | ( |  | ) | const
| inline

Definition at line 83 of file ToolHandle.h.

83 { return getAsIAlgTool(); }
BaseToolHandle::getAsIAlgTool
virtual const IAlgTool * getAsIAlgTool() const =0

## ◆ get() [2/2]

IAlgTool* BaseToolHandle::get | ( |  | ) |
| inline

Definition at line 85 of file ToolHandle.h.

85 { return getAsIAlgTool(); }
BaseToolHandle::getAsIAlgTool
virtual const IAlgTool * getAsIAlgTool() const =0

## ◆ getAsIAlgTool() [1/2]

virtual const IAlgTool* BaseToolHandle::getAsIAlgTool | ( |  | ) | const
| protected pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## ◆ getAsIAlgTool() [2/2]

virtual IAlgTool* BaseToolHandle::getAsIAlgTool | ( |  | ) |
| protected pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## ◆ i_retrieve()

virtual StatusCode BaseToolHandle::i_retrieve | ( | IAlgTool *& |  | ) | const
| protected pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## ◆ isEnabled()

bool BaseToolHandle::isEnabled | ( |  | ) | const
| inline

Helper to check if the ToolHandle should be retrieved.

Definition at line 90 of file ToolHandle.h.

90 {
91 // the handle is considered enabled if the type/name is valid and the
92 // enabled flag was set to true, or it was already retrieved
93 return ( m_enabled && !typeAndName().empty() ) || get();
94 }
BaseToolHandle::typeAndName
virtual std::string typeAndName() const =0
BaseToolHandle::get
const IAlgTool * get() const
Definition: ToolHandle.h:83
BaseToolHandle::m_enabled
bool m_enabled
Definition: ToolHandle.h:111

## ◆ retrieve() [1/4]

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

Definition at line 77 of file ToolHandle.h.

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

## ◆ retrieve() [2/4]

virtual StatusCode BaseToolHandle::retrieve | ( |  | ) | const
| pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## ◆ retrieve() [3/4]

virtual StatusCode BaseToolHandle::retrieve | ( | DisableTool | sd | ) |
| pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## ◆ retrieve() [4/4]

virtual StatusCode BaseToolHandle::retrieve | ( | EnableTool | sd | ) |
| pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## ◆ setEnabled()

bool BaseToolHandle::setEnabled | ( | const bool | flag | ) |
| inline

Definition at line 100 of file ToolHandle.h.

100 {
101 auto old = m_enabled;
102 m_enabled = flag;
103 return old;
104 }
BaseToolHandle::m_enabled
bool m_enabled
Definition: ToolHandle.h:111

## ◆ typeAndName()

virtual std::string BaseToolHandle::typeAndName | ( |  | ) | const
| pure virtual

Implemented in ToolHandle< T >, and ToolHandle< IThreadInitTool >.

## Member Data Documentation

## ◆ m_enabled

bool BaseToolHandle::m_enabled = true
| protected

Definition at line 111 of file ToolHandle.h.

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

- GaudiKernel/GaudiKernel/ToolHandle.h