| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ToolHandleArray< T > Class Template Reference

`#include <GaudiKernel/ToolHandle.h>`

Inheritance diagram for ToolHandleArray< T >:

[legend]
Collaboration diagram for ToolHandleArray< T >:

[legend]
List of all members.

## Detailed Description

### template<class T>
class ToolHandleArray< T >

Array of Handles to be used in lieu of vector of naked pointers to tools.

This allows better control through the framework of tool loading and usage. T is the AlgTool interface class (or concrete class) of the tool to use, and must derive from IAlgTool.

Author:
  Martin.Woudstra@cern.ch

Definition at line 160 of file ToolHandle.h.

## Public Member Functions
| ToolHandleArray (const std::vector< std::string > &myTypesAndNames, const IInterface *parent=0, bool createIf=true)
| Generic constructor.
| ToolHandleArray (const IInterface *parent=0, bool createIf=true)
| Constructor which creates and empty list.
virtual bool | push_back (const std::string &toolTypeAndName)
| Add a handle to the array with given tool type and name.
virtual bool | push_back (const ToolHandle< T > &myHandle)
| Ensure that for added handles the parent and creatIf are taken from this array.

## Constructor & Destructor Documentation

template<class T>

ToolHandleArray< T >::ToolHandleArray | ( | const std::vector< std::string > & | myTypesAndNames,
|  | const IInterface * | parent = `0`,
|  | bool | createIf = `true` |
| ) |  |  | `[inline]`

Generic constructor.

Probably not very useful...

Parameters:

  | typesAndNamesList | : a vector of strings with the concrete "type/name" strings for the list of tools
  | parent | : passed on to ToolHandle, so has the same meaning as for ToolHandle
  | createIf | : passed on to ToolHandle, so has the same meaning as for ToolHandle

Definition at line 171 of file ToolHandle.h.

    00173     : ToolHandleInfo( parent, createIf ),
    00174       GaudiHandleArray< ToolHandle<T> >( myTypesAndNames,
    00175                                          ToolHandleInfo::toolComponentType(parent),
    00176                                          ToolHandleInfo::toolParentName(parent) )
    00177   {}

template<class T>

ToolHandleArray< T >::ToolHandleArray | ( | const IInterface * | parent = `0`,
|  | bool | createIf = `true` |
| ) |  |  | `[inline]`

Constructor which creates and empty list.

Parameters:

  | parent | : passed on to ToolHandle, so has the same meaning as for ToolHandle
  | createIf | : passed on to ToolHandle, so has the same meaning as for ToolHandle

Definition at line 183 of file ToolHandle.h.

    00184     : ToolHandleInfo( parent, createIf ),
    00185       GaudiHandleArray< ToolHandle<T> >( ToolHandleInfo::toolComponentType(parent),
    00186                                          ToolHandleInfo::toolParentName(parent) )
    00187   { }

## Member Function Documentation

template<class T>

virtual bool ToolHandleArray< T >::push_back | ( | const std::string & | toolTypeAndName | ) | `[inline, virtual]`

Add a handle to the array with given tool type and name.

This function overrides the one in GaudiHandleArray<T>, as this is a special case. The private/public choice and createIf is determined by what was given in the constructor of the ToolHandleArray.

Implements GaudiHandleArrayBase.

Definition at line 193 of file ToolHandle.h.

References ToolHandleInfo::createIf(), and ToolHandleInfo::parent().

Referenced by ToolHandleArray< T >::push_back().

    00193                                                              {
    00194     ToolHandle<T> handle( toolTypeAndName,
    00195                           ToolHandleInfo::parent(),
    00196                           ToolHandleInfo::createIf() );
    00197     GaudiHandleArray< ToolHandle<T> >::push_back( handle );
    00198     return true;
    00199   }

template<class T>

virtual bool ToolHandleArray< T >::push_back | ( | const ToolHandle< T > & | myHandle | ) | `[inline, virtual]`

Ensure that for added handles the parent and creatIf are taken from this array.

Reimplemented from GaudiHandleArray< ToolHandle< T > >.

Definition at line 202 of file ToolHandle.h.

References ToolHandleArray< T >::push_back(), and GaudiHandleBase::typeAndName().

    00202                                                           {
    00203     return push_back( myHandle.typeAndName() );
    00204   }

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiKernel/v25r2/GaudiKernel/ToolHandle.h