| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# ServiceHandleArray< T > Class Template Reference

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

`#include <GaudiKernel/ServiceHandle.h>`

Inheritance diagram for ServiceHandleArray< T >:

[legend]
Collaboration diagram for ServiceHandleArray< T >:

[legend]

List of all members.

## Public Member Functions
| ServiceHandleArray (const std::vector< std::string > &myTypesAndNamesList, const std::string &myComponentType, const std::string &myParentName)
| Generic constructor.
| ServiceHandleArray (const std::string &myParentName)
virtual bool | push_back (const std::string &serviceTypeAndName)
| Add a handle to the array with "type/name" given in <myHandleTypeAndName>.
virtual bool | push_back (const ServiceHandle< T > &myHandle)

## Detailed Description

### template<class T>
class ServiceHandleArray< 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:
  Yushu Yao <yyao@lbl.gov>

Definition at line 112 of file ServiceHandle.h.

## Constructor & Destructor Documentation

template<class T>

ServiceHandleArray< T >::ServiceHandleArray | ( | const std::vector< std::string > & | myTypesAndNamesList,
|  | const std::string & | myComponentType,
|  | const std::string & | myParentName |
| ) |  |  | `[inline]`

Generic constructor.

Probably not very useful...

Definition at line 119 of file ServiceHandle.h.

    00120                                                                                         :
    00121     GaudiHandleArray< ServiceHandle<T> >( myTypesAndNamesList,
    00122                                           myComponentType,
    00123                                           myParentName)
    00124   {  }

template<class T>

ServiceHandleArray< T >::ServiceHandleArray | ( | const std::string & | myParentName | ) | `[inline]`

Definition at line 126 of file ServiceHandle.h.

    00127     : GaudiHandleArray< ServiceHandle<T> >( "Service", myParentName)
    00128   { }

## Member Function Documentation

template<class T>

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

Add a handle to the array with "type/name" given in <myHandleTypeAndName>.

Return whether addition was successful or not. Must be implemented by derived class with concrete handle category.

Implements GaudiHandleArrayBase.

Definition at line 130 of file ServiceHandle.h.

    00130                                                                 {
    00131     ServiceHandle<T> handle( serviceTypeAndName,GaudiHandleInfo::parentName());
    00132     GaudiHandleArray< ServiceHandle<T> >::push_back( handle );
    00133     return true;
    00134   }

template<class T>

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

Reimplemented from GaudiHandleArray< ServiceHandle< T > >.

Definition at line 136 of file ServiceHandle.h.

    00136                                                              {
    00137     return push_back( myHandle.typeAndName() );
    00138   }

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r10p1/GaudiKernel/GaudiKernel/ServiceHandle.h