Gaudi Framework, version v20r3

Generated: 24 Nov 2008

GaudiHandleArrayBase Class Reference

#include <GaudiHandle.h>

Inheritance diagram for GaudiHandleArrayBase:

Inheritance graph
[legend]
Collaboration diagram for GaudiHandleArrayBase:

Collaboration graph
[legend]

List of all members.


Detailed Description

Base class of array's of various gaudihandles.

Used in communication with GaudiHandleArrayProperty. For that purpose is has some pure virtual functions. This is a non-templated class to one Property can handle all kinds of concrete handles.

Definition at line 293 of file GaudiHandle.h.


Public Types

typedef std::vector
< GaudiHandleBase * > 
BaseHandleArray
typedef std::vector< const
GaudiHandleBase * > 
ConstBaseHandleArray

Public Member Functions

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 (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.
virtual const std::string pythonPropertyClassName () const
 Name of the componentType with "HandleArray" appended.
virtual const std::string pythonRepr () const
 Python representation of array of handles, i.e.
virtual bool push_back (const std::string &myHandleTypeAndName)=0
 Add a handle to the array with "type/name" given in <myHandleTypeAndName>.
virtual void clear ()=0
 Clear the list of handles.
virtual bool empty () const =0
 Return whether the list of tools is empty.
virtual ConstBaseHandleArray getBaseArray () const =0
 Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
virtual BaseHandleArray getBaseArray ()=0
 Get a read-write vector of GaudiHandleBase* pointing to the real handles.

Protected Member Functions

 GaudiHandleArrayBase (const std::string &myComponentType, const std::string &myParentName)

Member Typedef Documentation

Definition at line 299 of file GaudiHandle.h.

Definition at line 300 of file GaudiHandle.h.


Constructor & Destructor Documentation

GaudiHandleArrayBase::GaudiHandleArrayBase ( const std::string &  myComponentType,
const std::string &  myParentName 
) [inline, protected]

Definition at line 295 of file GaudiHandle.h.

00296     : GaudiHandleInfo(myComponentType,myParentName)
00297   {}


Member Function Documentation

bool GaudiHandleArrayBase::setTypesAndNames ( const std::vector< std::string > &  myTypesAndNamesList  ) 

Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.

Return whether set was successful or not

Definition at line 63 of file GaudiHandle.cpp.

00063                                                                                                 {
00064   clear();
00065   std::vector< std::string >::const_iterator it = myTypesAndNamesList.begin(), 
00066     itEnd = myTypesAndNamesList.end();
00067   for ( ; it != itEnd; ++it ) {
00068     if ( !push_back( *it ) ) return false;
00069   }
00070   return true;
00071 }

const std::vector< std::string > GaudiHandleArrayBase::typesAndNames (  )  const

Return a vector with "type/name" strings of all handles in the array.

Inverse of setTypesAndNames()

Definition at line 83 of file GaudiHandle.cpp.

00083                                                                        {
00084   return getBaseInfos( &GaudiHandleBase::typeAndName );
00085 }

const std::vector< std::string > GaudiHandleArrayBase::types (  )  const

Return a vector with "type" strings of all handles in the array.

Definition at line 87 of file GaudiHandle.cpp.

00087                                                                {
00088   return getBaseInfos( &GaudiHandleBase::type );
00089 }

const std::vector< std::string > GaudiHandleArrayBase::names (  )  const

Return a vector with "type/name" strings of all handles in the array.

Definition at line 91 of file GaudiHandle.cpp.

00091                                                                {
00092   return getBaseInfos( &GaudiHandleBase::name );
00093 }

const std::vector< std::string > GaudiHandleArrayBase::getBaseInfos ( std::string(GaudiHandleBase::*)() const   pMemFunc  )  const

Helper function to get a vector of strings filled with the return value of each tool of a member function if GaudiHandleBase.

Definition at line 74 of file GaudiHandle.cpp.

00074                                                                                        {
00075   std::vector< std::string > theList;
00076   const GaudiHandleArrayBase::ConstBaseHandleArray& baseArray = getBaseArray();
00077   GaudiHandleArrayBase::ConstBaseHandleArray::const_iterator it = baseArray.begin(),
00078     itEnd = baseArray.end();
00079   for ( ; it != itEnd; ++it ) theList.push_back( ((*it)->*pMemFunc)() );
00080   return theList;
00081 }

const std::string GaudiHandleArrayBase::pythonPropertyClassName (  )  const [virtual]

Name of the componentType with "HandleArray" appended.

Used as the python class name for the property in the genconf-generated configurables. The python class is defined in GaudiPython/python/GaudiHandles.py.

Implements GaudiHandleInfo.

Definition at line 95 of file GaudiHandle.cpp.

00095                                                                     {
00096   return componentType() + "HandleArray";
00097 }

const std::string GaudiHandleArrayBase::pythonRepr (  )  const [virtual]

Python representation of array of handles, i.e.

list of python handles. Can be used in the genconf-generated configurables. The corresponding python classes are defined in GaudiPython/GaudiHandles.py

Implements GaudiHandleInfo.

Definition at line 99 of file GaudiHandle.cpp.

00099                                                        {
00100   std::string repr = pythonPropertyClassName() + "([";
00101   const std::vector< std::string >& theList = typesAndNames();
00102   std::vector< std::string >::const_iterator it = theList.begin(),
00103     itEnd = theList.end(), itLast = itEnd - 1;
00104   for ( ; it != itEnd; ++it ) {
00105     repr += "'" + *it + "'";
00106     if ( it != itLast ) repr += ",";
00107   }
00108   repr += "])";
00109   return repr;
00110 }

virtual bool GaudiHandleArrayBase::push_back ( const std::string &  myHandleTypeAndName  )  [pure 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.

Implemented in ToolHandleArray< T >.

virtual void GaudiHandleArrayBase::clear (  )  [pure virtual]

Clear the list of handles.

Implemented in GaudiHandleArray

Implemented in GaudiHandleArray< T >, and GaudiHandleArray< ToolHandle< T > >.

virtual bool GaudiHandleArrayBase::empty (  )  const [pure virtual]

Return whether the list of tools is empty.

Implemented in GaudiHandleArray< T >, and GaudiHandleArray< ToolHandle< T > >.

virtual ConstBaseHandleArray GaudiHandleArrayBase::getBaseArray (  )  const [pure virtual]

Get a read-only vector of const GaudiHandleBase* pointing to the real handles.

Implemented in GaudiHandleArray.

Implemented in GaudiHandleArray< T >, and GaudiHandleArray< ToolHandle< T > >.

virtual BaseHandleArray GaudiHandleArrayBase::getBaseArray (  )  [pure virtual]

Get a read-write vector of GaudiHandleBase* pointing to the real handles.

Implemented in GaudiHandleArray.

Implemented in GaudiHandleArray< T >, and GaudiHandleArray< ToolHandle< T > >.


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

Generated at Mon Nov 24 14:45:19 2008 for Gaudi Framework, version v20r3 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004