The Gaudi Framework  master (bb95dfce)
Loading...
Searching...
No Matches
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 >:
Collaboration diagram for ServiceHandleArray< T >:

Public Member Functions

 ServiceHandleArray (const std::vector< std::string > &myTypesAndNamesList, const std::string &myComponentType, const std::string &myParentName)
 Generic constructor.
virtual ~ServiceHandleArray ()
 ServiceHandleArray (const std::string &myParentName)
virtual bool push_back (const std::string &serviceTypeAndName)
 Add a handle with given type and name.
virtual bool push_back (const ServiceHandle< T > &myHandle)
Public Member Functions inherited from GaudiHandleArray< ServiceHandle< T > >
GaudiHandleArrayoperator= (const std::vector< std::string > &myTypesAndNamesList)
 Set the array of GaudiHandles from typeAndNames given in vector of strings.
GaudiHandleArrayBase::BaseHandleArray getBaseArray () override
 Get a read-write vector of GaudiHandleBase* pointing to the real handles.
iterator begin ()
iterator end ()
const_iterator rbegin () const
const_iterator rend () const
size_type size () const
void clear () override
 Clear the list of handles.
bool empty () const override
 Return whether the list of tools is empty.
T & operator[] (int index)
StatusCode retrieve () override
 Retrieve all tools.
StatusCode release () override
 Release all tools.
virtual bool retrieved () const override
 has Array been retreived?
Public Member Functions inherited from GaudiHandleArrayBase
bool setTypesAndNames (const std::vector< std::string > &myTypesAndNamesList)
 Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
const std::vector< std::string > typesAndNames () const
 Return a vector with "type/name" strings of all handles in the array.
const std::vector< std::string > types () const
 Return a vector with "type" strings of all handles in the array.
const std::vector< std::string > names () const
 Return a vector with "type/name" strings of all handles in the array.
const std::vector< std::string > getBaseInfos (auto(GaudiHandleBase::*pMemFunc)() const) const
 Helper function to get a vector of strings filled with the return value of each tool of a member function if GaudiHandleBase.
std::string pythonPropertyClassName () const override
 Name of the componentType with "HandleArray" appended.
std::string pythonRepr () const override
 Python representation of array of handles, i.e.
virtual ConstBaseHandleArray getBaseArray () const =0
 Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
Public Member Functions inherited from GaudiHandleInfo
virtual ~GaudiHandleInfo ()
 virtual destructor so that derived class destructor is called.
const std::string & componentType () const
const std::string & propertyName () const
 name as used in declareProperty(name,gaudiHandle)
void setPropertyName (std::string propName)
 set name as used in declareProperty(name,gaudiHandle).
const std::string & parentName () const
 The name of the parent.

Additional Inherited Members

Public Types inherited from GaudiHandleArray< ServiceHandle< T > >
typedef std::vector< T > HandleVector
typedef HandleVector::value_type value_type
typedef HandleVector::size_type size_type
typedef HandleVector::reference reference
typedef HandleVector::const_reference const_reference
typedef HandleVector::iterator iterator
typedef HandleVector::const_iterator const_iterator
typedef HandleVector::reverse_iterator reverse_iterator
typedef HandleVector::const_reverse_iterator const_reverse_iterator
Public Types inherited from GaudiHandleArrayBase
using PropertyType = GaudiHandleArrayProperty
typedef std::vector< GaudiHandleBase * > BaseHandleArray
typedef std::vector< const GaudiHandleBase * > ConstBaseHandleArray
Protected Member Functions inherited from GaudiHandleArray< ServiceHandle< T > >
 GaudiHandleArray (const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
 Generic constructor.
Protected Member Functions inherited from GaudiHandleArrayBase
 GaudiHandleArrayBase (std::string myComponentType, std::string myParentName)
Protected Member Functions inherited from GaudiHandleInfo
 GaudiHandleInfo (std::string myComponentType, std::string myParentName)
 Some basic information and helper functions shared between various handles/arrays.
void setComponentType (std::string componentType)
 The component type.
void setParentName (std::string parent)
 The name of the parent.

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. @parameter T is the AlgTool interface class (or concrete class) of the tool to use, and must derive from IAlgTool.

Author
Yushu Yao yyao@.nosp@m.lbl..nosp@m.gov

Definition at line 134 of file ServiceHandle.h.

Constructor & Destructor Documentation

◆ ServiceHandleArray() [1/2]

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 138 of file ServiceHandle.h.

GaudiHandleArray(const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
Array of Handles to be used in lieu of vector of naked pointers to tools.

◆ ~ServiceHandleArray()

template<class T>
virtual ServiceHandleArray< T >::~ServiceHandleArray ( )
inlinevirtual

Definition at line 142 of file ServiceHandle.h.

142{}

◆ ServiceHandleArray() [2/2]

template<class T>
ServiceHandleArray< T >::ServiceHandleArray ( const std::string & myParentName)
inline

Definition at line 144 of file ServiceHandle.h.

Member Function Documentation

◆ push_back() [1/2]

template<class T>
virtual bool ServiceHandleArray< T >::push_back ( const ServiceHandle< T > & myHandle)
inlinevirtual

Definition at line 153 of file ServiceHandle.h.

153{ return push_back( myHandle.typeAndName() ); }
virtual bool push_back(const std::string &serviceTypeAndName)
Add a handle with given type and name.

◆ push_back() [2/2]

template<class T>
virtual bool ServiceHandleArray< T >::push_back ( const std::string & myHandleTypeAndName)
inlinevirtual

Add a handle with given type and name.

Can be overridden in derived class. Return whether addition was successful or not.

Reimplemented from GaudiHandleArray< ServiceHandle< T > >.

Definition at line 147 of file ServiceHandle.h.


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