Gaudi Framework, version v22r4

Home   Generated: Fri Sep 2 2011
Public Types | Public Member Functions | Protected Member Functions

GaudiHandleArrayBase Class Reference

Base class of array's of various gaudihandles. More...

#include <GaudiHandle.h>

Inheritance diagram for GaudiHandleArrayBase:
Inheritance graph
[legend]
Collaboration diagram for GaudiHandleArrayBase:
Collaboration graph
[legend]

List of all members.

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::stringtypesAndNames () const
 Return a vector with "type/name" strings of all handles in the array.
const std::vector< std::stringtypes () const
 Return a vector with "type" strings of all handles in the array.
const std::vector< std::stringnames () const
 Return a vector with "type/name" strings of all handles in the array.
const std::vector< std::stringgetBaseInfos (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)

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.


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.

    : GaudiHandleInfo(myComponentType,myParentName)
  {}

Member Function Documentation

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

Return whether the list of tools is empty.

Implemented in GaudiHandleArray< T >, GaudiHandleArray< ToolHandle< T > >, and GaudiHandleArray< ServiceHandle< 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 >, GaudiHandleArray< ToolHandle< T > >, and GaudiHandleArray< ServiceHandle< 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 >, GaudiHandleArray< ToolHandle< T > >, and GaudiHandleArray< ServiceHandle< T > >.

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.

                                                                                       {
  std::vector< std::string > theList;
  const GaudiHandleArrayBase::ConstBaseHandleArray& baseArray = getBaseArray();
  GaudiHandleArrayBase::ConstBaseHandleArray::const_iterator it = baseArray.begin(),
    itEnd = baseArray.end();
  for ( ; it != itEnd; ++it ) theList.push_back( ((*it)->*pMemFunc)() );
  return theList;
}
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.

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 ServiceHandleArray< T >, and ToolHandleArray< T >.

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.

                                                                    {
  return componentType() + "HandleArray";
}
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.

                                                       {
  std::string repr = pythonPropertyClassName() + "([";
  const std::vector< std::string >& theList = typesAndNames();
  std::vector< std::string >::const_iterator it = theList.begin(),
    itEnd = theList.end(), itLast = itEnd - 1;
  for ( ; it != itEnd; ++it ) {
    repr += "'" + *it + "'";
    if ( it != itLast ) repr += ",";
  }
  repr += "])";
  return repr;
}
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.

                                                                                                {
  clear();
  std::vector< std::string >::const_iterator it = myTypesAndNamesList.begin(), 
    itEnd = myTypesAndNamesList.end();
  for ( ; it != itEnd; ++it ) {
    if ( !push_back( *it ) ) return false;
  }
  return true;
}
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.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Fri Sep 2 2011 16:25:23 for Gaudi Framework, version v22r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004