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. More...
 
virtual ~ServiceHandleArray ()
 
 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>. More...
 
virtual bool push_back (const ServiceHandle< T > &myHandle)
 
 ServiceHandleArray (const std::vector< std::string > &myTypesAndNamesList, const std::string &myComponentType, const std::string &myParentName)
 Generic constructor. More...
 
virtual ~ServiceHandleArray ()
 
 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>. More...
 
virtual bool push_back (const ServiceHandle< T > &myHandle)
 
- Public Member Functions inherited from GaudiHandleArray< ServiceHandle< T > >
virtual ~GaudiHandleArray ()
 
virtual ~GaudiHandleArray ()
 
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...
 
virtual GaudiHandleArrayBase::BaseHandleArray getBaseArray ()
 Get a read-write vector of GaudiHandleBase* pointing to the real handles. More...
 
virtual GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray () const
 Get a read-only vector of const GaudiHandleBase* pointing to the real handles. More...
 
virtual GaudiHandleArrayBase::BaseHandleArray getBaseArray ()
 Get a read-write vector of GaudiHandleBase* pointing to the real handles. More...
 
virtual GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray () const
 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
 
virtual void clear ()
 Clear the list of handles. More...
 
virtual void clear ()
 Clear the list of handles. More...
 
virtual bool empty () const
 Return whether the list of tools is empty. More...
 
virtual bool empty () const
 Return whether the list of tools is empty. More...
 
ServiceHandle< T > & operator[] (int index)
 
const ServiceHandle< T > & operator[] (int index) const
 
ServiceHandle< T > * operator[] (const std::string &name)
 Get pointer (!) to ToolHandle by instance name. More...
 
const ServiceHandle< T > * operator[] (const std::string &name) const
 Get const pointer (!) to ToolHandle by instance name. More...
 
ServiceHandle< T > & operator[] (int index)
 
const ServiceHandle< T > & operator[] (int index) const
 
ServiceHandle< T > * operator[] (const std::string &name)
 Get pointer (!) to ToolHandle by instance name. More...
 
const ServiceHandle< 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...
 
virtual const std::string pythonPropertyClassName () const
 Name of the componentType with "HandleArray" appended. More...
 
virtual const std::string pythonRepr () const
 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...
 
virtual const std::string pythonPropertyClassName () const
 Name of the componentType with "HandleArray" appended. More...
 
virtual const std::string pythonRepr () const
 Python representation of array of handles, i.e. More...
 
- Public Member Functions inherited from GaudiHandleInfo
virtual ~GaudiHandleInfo ()
 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 (const 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 ()
 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 (const 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< ServiceHandle< T > >
typedef std::vector< ServiceHandle< T > > HandleVector
 
typedef std::vector< ServiceHandle< 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
 
- Protected Member Functions inherited from GaudiHandleArray< ServiceHandle< T > >
 GaudiHandleArray (const std::vector< std::string > &myTypesAndNamesList, const std::string &myComponentType, const 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, const std::string &myComponentType, const 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 (const std::string &myComponentType, const std::string &myParentName)
 
 GaudiHandleArrayBase (const std::string &myComponentType, const std::string &myParentName)
 
- Protected Member Functions inherited from GaudiHandleInfo
 GaudiHandleInfo (const std::string &myComponentType, const std::string &myParentName)
 Some basic information and helper functions shared between various handles/arrays. More...
 
 GaudiHandleInfo (const std::string &myComponentType, const std::string &myParentName)
 Some basic information and helper functions shared between various handles/arrays. More...
 

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@.nosp@m.lbl..nosp@m.gov

Definition at line 23 of file PropertyMgr.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.

120  :
121  GaudiHandleArray< ServiceHandle<T> >( myTypesAndNamesList,
122  myComponentType,
123  myParentName)
124  { }
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:363
template<class T>
virtual ServiceHandleArray< T >::~ServiceHandleArray ( )
inlinevirtual

Definition at line 126 of file ServiceHandle.h.

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

Definition at line 128 of file ServiceHandle.h.

129  : GaudiHandleArray< ServiceHandle<T> >( "Service", myParentName)
130  { }
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:363
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.

120  :
121  GaudiHandleArray< ServiceHandle<T> >( myTypesAndNamesList,
122  myComponentType,
123  myParentName)
124  { }
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:363
template<class T>
virtual ServiceHandleArray< T >::~ServiceHandleArray ( )
inlinevirtual

Definition at line 126 of file ServiceHandle.h.

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

Definition at line 128 of file ServiceHandle.h.

129  : GaudiHandleArray< ServiceHandle<T> >( "Service", myParentName)
130  { }
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:363

Member Function Documentation

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

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

132  {
133  ServiceHandle<T> handle( serviceTypeAndName,GaudiHandleInfo::parentName());
135  return true;
136  }
Handle to be used in lieu of naked pointers to services.
Definition: PropertyMgr.h:21
const std::string & parentName() const
The name of the parent.
Definition: GaudiHandle.h:48
virtual bool push_back(const std::string &serviceTypeAndName)
Add a handle to the array with "type/name" given in .
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:363
template<class T>
virtual bool ServiceHandleArray< T >::push_back ( const std::string &  myHandleTypeAndName)
inlinevirtual

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

132  {
133  ServiceHandle<T> handle( serviceTypeAndName,GaudiHandleInfo::parentName());
135  return true;
136  }
Handle to be used in lieu of naked pointers to services.
Definition: PropertyMgr.h:21
const std::string & parentName() const
The name of the parent.
Definition: GaudiHandle.h:48
virtual bool push_back(const std::string &serviceTypeAndName)
Add a handle to the array with "type/name" given in .
T is the concrete handle type, e.g.
Definition: GaudiHandle.h:363
template<class T>
virtual bool ServiceHandleArray< T >::push_back ( const ServiceHandle< T > &  myHandle)
inlinevirtual

Reimplemented from GaudiHandleArray< ServiceHandle< T > >.

Definition at line 138 of file ServiceHandle.h.

138  {
139  return push_back( myHandle.typeAndName() );
140  }
virtual bool push_back(const std::string &serviceTypeAndName)
Add a handle to the array with "type/name" given in .
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:107
template<class T>
virtual bool ServiceHandleArray< T >::push_back ( const ServiceHandle< T > &  myHandle)
inlinevirtual

Reimplemented from GaudiHandleArray< ServiceHandle< T > >.

Definition at line 138 of file ServiceHandle.h.

138  {
139  return push_back( myHandle.typeAndName() );
140  }
virtual bool push_back(const std::string &serviceTypeAndName)
Add a handle to the array with "type/name" given in .
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:107

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