ToolHandleArray< T > Class Template Reference

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

#include <GaudiKernel/ToolHandle.h>

Inheritance diagram for ToolHandleArray< T >:
Collaboration diagram for ToolHandleArray< T >:

Public Member Functions

 ToolHandleArray (const std::vector< std::string > &myTypesAndNames, const IInterface *parent=0, bool createIf=true)
 Generic constructor. More...
 
 ToolHandleArray (const IInterface *parent=0, bool createIf=true)
 Constructor which creates and empty list. More...
 
virtual bool push_back (const std::string &toolTypeAndName)
 Add a handle to the array with given tool type and name. More...
 
virtual bool push_back (const ToolHandle< T > &myHandle)
 Ensure that for added handles the parent and creatIf are taken from this array. More...
 
 ToolHandleArray (const std::vector< std::string > &myTypesAndNames, const IInterface *parent=0, bool createIf=true)
 Generic constructor. More...
 
 ToolHandleArray (const IInterface *parent=0, bool createIf=true)
 Constructor which creates and empty list. More...
 
virtual bool push_back (const std::string &toolTypeAndName)
 Add a handle to the array with given tool type and name. More...
 
virtual bool push_back (const ToolHandle< T > &myHandle)
 Ensure that for added handles the parent and creatIf are taken from this array. More...
 
- Public Member Functions inherited from ToolHandleInfo
virtual ~ToolHandleInfo ()=default
 
bool isPublic () const
 
bool createIf () const
 
const IInterfaceparent () const
 
virtual ~ToolHandleInfo ()=default
 
bool isPublic () const
 
bool createIf () const
 
const IInterfaceparent () const
 
- Public Member Functions inherited from GaudiHandleArray< ToolHandle< T > >
virtual ~GaudiHandleArray ()=default
 
virtual ~GaudiHandleArray ()=default
 
GaudiHandleArrayoperator= (const std::vector< std::string > &myTypesAndNamesList)
 Set the array of GaudiHandles from typeAndNames given in vector of strings. More...
 
GaudiHandleArrayoperator= (const std::vector< std::string > &myTypesAndNamesList)
 Set the array of GaudiHandles from typeAndNames given in vector of strings. More...
 
GaudiHandleArrayBase::BaseHandleArray getBaseArray () override
 Get a read-write vector of GaudiHandleBase* pointing to the real handles. More...
 
GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray () const override
 Get a read-only vector of const GaudiHandleBase* pointing to the real handles. More...
 
GaudiHandleArrayBase::BaseHandleArray getBaseArray () override
 Get a read-write vector of GaudiHandleBase* pointing to the real handles. More...
 
GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray () const override
 Get a read-only vector of const GaudiHandleBase* pointing to the real handles. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator rbegin () const
 
const_iterator rbegin () const
 
const_iterator rend () const
 
const_iterator rend () const
 
size_type size () const
 
size_type size () const
 
void clear () override
 Clear the list of handles. More...
 
void clear () override
 Clear the list of handles. More...
 
bool empty () const override
 Return whether the list of tools is empty. More...
 
bool empty () const override
 Return whether the list of tools is empty. More...
 
ToolHandle< T > & operator[] (int index)
 
const ToolHandle< T > & operator[] (int index) const
 
ToolHandle< T > * operator[] (const std::string &name)
 Get pointer (!) to ToolHandle by instance name. More...
 
const ToolHandle< T > * operator[] (const std::string &name) const
 Get const pointer (!) to ToolHandle by instance name. More...
 
ToolHandle< T > & operator[] (int index)
 
const ToolHandle< T > & operator[] (int index) const
 
ToolHandle< T > * operator[] (const std::string &name)
 Get pointer (!) to ToolHandle by instance name. More...
 
const ToolHandle< T > * operator[] (const std::string &name) const
 Get const pointer (!) to ToolHandle by instance name. More...
 
StatusCode retrieve ()
 Retrieve all tools. More...
 
StatusCode retrieve ()
 Retrieve all tools. More...
 
StatusCode release ()
 Release all tools. More...
 
StatusCode release ()
 Release all tools. More...
 
- 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>. More...
 
const std::vector< std::string > typesAndNames () const
 Return a vector with "type/name" strings of all handles in the array. More...
 
const std::vector< std::string > types () const
 Return a vector with "type" strings of all handles in the array. More...
 
const std::vector< std::string > names () const
 Return a vector with "type/name" strings of all handles in the array. More...
 
const std::vector< std::string > getBaseInfos (std::string(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. More...
 
std::string pythonPropertyClassName () const override
 Name of the componentType with "HandleArray" appended. More...
 
std::string pythonRepr () const override
 Python representation of array of handles, i.e. More...
 
bool setTypesAndNames (const std::vector< std::string > &myTypesAndNamesList)
 Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>. More...
 
const std::vector< std::string > typesAndNames () const
 Return a vector with "type/name" strings of all handles in the array. More...
 
const std::vector< std::string > types () const
 Return a vector with "type" strings of all handles in the array. More...
 
const std::vector< std::string > names () const
 Return a vector with "type/name" strings of all handles in the array. More...
 
const std::vector< std::string > getBaseInfos (std::string(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. More...
 
std::string pythonPropertyClassName () const override
 Name of the componentType with "HandleArray" appended. More...
 
std::string pythonRepr () const override
 Python representation of array of handles, i.e. More...
 
- Public Member Functions inherited from GaudiHandleInfo
virtual ~GaudiHandleInfo ()=default
 virtual destructor so that derived class destructor is called. More...
 
const std::string & componentType () const
 
const std::string & propertyName () const
 name as used in declareProperty(name,gaudiHandle) More...
 
void setPropertyName (std::string propName)
 set name as used in declareProperty(name,gaudiHandle). More...
 
const std::string & parentName () const
 The name of the parent. More...
 
virtual ~GaudiHandleInfo ()=default
 virtual destructor so that derived class destructor is called. More...
 
const std::string & componentType () const
 
const std::string & propertyName () const
 name as used in declareProperty(name,gaudiHandle) More...
 
void setPropertyName (std::string propName)
 set name as used in declareProperty(name,gaudiHandle). More...
 
const std::string & parentName () const
 The name of the parent. More...
 

Additional Inherited Members

- Public Types inherited from GaudiHandleArray< ToolHandle< T > >
typedef std::vector< ToolHandle< T > > HandleVector
 
typedef std::vector< ToolHandle< T > > HandleVector
 
typedef HandleVector::value_type value_type
 
typedef HandleVector::value_type value_type
 
typedef HandleVector::size_type size_type
 
typedef HandleVector::size_type size_type
 
typedef HandleVector::reference reference
 
typedef HandleVector::reference reference
 
typedef HandleVector::const_reference const_reference
 
typedef HandleVector::const_reference const_reference
 
typedef HandleVector::iterator iterator
 
typedef HandleVector::iterator iterator
 
typedef HandleVector::const_iterator const_iterator
 
typedef HandleVector::const_iterator const_iterator
 
typedef HandleVector::reverse_iterator reverse_iterator
 
typedef HandleVector::reverse_iterator reverse_iterator
 
typedef HandleVector::const_reverse_iterator const_reverse_iterator
 
typedef HandleVector::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from GaudiHandleArrayBase
typedef std::vector< GaudiHandleBase * > BaseHandleArray
 
typedef std::vector< const GaudiHandleBase * > ConstBaseHandleArray
 
typedef std::vector< GaudiHandleBase * > BaseHandleArray
 
typedef std::vector< const GaudiHandleBase * > ConstBaseHandleArray
 
- Static Public Member Functions inherited from ToolHandleInfo
static std::string toolComponentType (const IInterface *parent)
 
static std::string toolParentName (const IInterface *parent)
 
static std::string toolComponentType (const IInterface *parent)
 
static std::string toolParentName (const IInterface *parent)
 
- Protected Member Functions inherited from ToolHandleInfo
 ToolHandleInfo (const IInterface *parent=nullptr, bool createIf=true)
 
 ToolHandleInfo (const IInterface *parent=nullptr, bool createIf=true)
 
- Protected Member Functions inherited from GaudiHandleArray< ToolHandle< T > >
 GaudiHandleArray (const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
 Generic constructor. More...
 
 GaudiHandleArray (const std::string &myComponentType, const std::string &myParentName)
 Constructor creating an empty array. More...
 
 GaudiHandleArray (const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
 Generic constructor. More...
 
 GaudiHandleArray (const std::string &myComponentType, const std::string &myParentName)
 Constructor creating an empty array. More...
 
- Protected Member Functions inherited from GaudiHandleArrayBase
 GaudiHandleArrayBase (std::string myComponentType, std::string myParentName)
 
 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. More...
 
void setComponentType (const std::string &componentType)
 The component type. More...
 
void setParentName (const std::string &parent)
 The name of the parent. More...
 
 GaudiHandleInfo (std::string myComponentType, std::string myParentName)
 Some basic information and helper functions shared between various handles/arrays. More...
 
void setComponentType (const std::string &componentType)
 The component type. More...
 
void setParentName (const std::string &parent)
 The name of the parent. More...
 
- Protected Attributes inherited from ToolHandleInfo
const IInterfacem_parent
 
bool m_createIf
 

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
Marti.nosp@m.n.Wo.nosp@m.udstr.nosp@m.a@ce.nosp@m.rn.ch

Definition at line 23 of file PropertyMgr.h.

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 235 of file ToolHandle.h.

237  : ToolHandleInfo( parent, createIf ),
238  GaudiHandleArray< ToolHandle<T> >( myTypesAndNames,
241  {}
static std::string toolParentName(const IInterface *parent)
Definition: ToolHandle.h:47
static std::string toolComponentType(const IInterface *parent)
Definition: ToolHandle.h:43
bool createIf() const
Definition: ToolHandle.h:36
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:27
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:380
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 247 of file ToolHandle.h.

248  : ToolHandleInfo( parent, createIf ),
251  { }
static std::string toolParentName(const IInterface *parent)
Definition: ToolHandle.h:47
static std::string toolComponentType(const IInterface *parent)
Definition: ToolHandle.h:43
bool createIf() const
Definition: ToolHandle.h:36
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:27
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:380
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 235 of file ToolHandle.h.

237  : ToolHandleInfo( parent, createIf ),
238  GaudiHandleArray< ToolHandle<T> >( myTypesAndNames,
241  {}
static std::string toolParentName(const IInterface *parent)
Definition: ToolHandle.h:47
static std::string toolComponentType(const IInterface *parent)
Definition: ToolHandle.h:43
bool createIf() const
Definition: ToolHandle.h:36
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:27
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:380
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 247 of file ToolHandle.h.

248  : ToolHandleInfo( parent, createIf ),
251  { }
static std::string toolParentName(const IInterface *parent)
Definition: ToolHandle.h:47
static std::string toolComponentType(const IInterface *parent)
Definition: ToolHandle.h:43
bool createIf() const
Definition: ToolHandle.h:36
ToolHandleInfo(const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:27
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:380

Member Function Documentation

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

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 257 of file ToolHandle.h.

257  {
258  ToolHandle<T> handle( toolTypeAndName,
262  return true;
263  }
const IInterface * parent() const
Definition: ToolHandle.h:38
bool createIf() const
Definition: ToolHandle.h:36
Handle to be used in lieu of naked pointers to tools.
Definition: PropertyMgr.h:21
virtual bool push_back(const std::string &toolTypeAndName)
Add a handle to the array with given tool type and name.
Definition: ToolHandle.h:257
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:380
template<class T>
virtual bool ToolHandleArray< T >::push_back ( const std::string &  toolTypeAndName)
inlinevirtual

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 257 of file ToolHandle.h.

257  {
258  ToolHandle<T> handle( toolTypeAndName,
262  return true;
263  }
const IInterface * parent() const
Definition: ToolHandle.h:38
bool createIf() const
Definition: ToolHandle.h:36
Handle to be used in lieu of naked pointers to tools.
Definition: PropertyMgr.h:21
virtual bool push_back(const std::string &toolTypeAndName)
Add a handle to the array with given tool type and name.
Definition: ToolHandle.h:257
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:380
template<class T>
virtual bool ToolHandleArray< T >::push_back ( const ToolHandle< T > &  myHandle)
inlinevirtual

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

Reimplemented from GaudiHandleArray< ToolHandle< T > >.

Definition at line 266 of file ToolHandle.h.

266  {
267  return push_back( myHandle.typeAndName() );
268  }
virtual bool push_back(const std::string &toolTypeAndName)
Add a handle to the array with given tool type and name.
Definition: ToolHandle.h:257
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:120
template<class T>
virtual bool ToolHandleArray< T >::push_back ( const ToolHandle< T > &  myHandle)
inlinevirtual

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

Reimplemented from GaudiHandleArray< ToolHandle< T > >.

Definition at line 266 of file ToolHandle.h.

266  {
267  return push_back( myHandle.typeAndName() );
268  }
virtual bool push_back(const std::string &toolTypeAndName)
Add a handle to the array with given tool type and name.
Definition: ToolHandle.h:257
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:120

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