| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | List of all members
GaudiHandleArrayBase Class Referenceabstract

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

`#include <GaudiKernel/GaudiHandle.h>`

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

## Public Types
using | PropertyType = GaudiHandleArrayProperty
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>. 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...
virtual bool | push_back (const std::string &myHandleTypeAndName)=0
| Add a handle to the array with "type/name" given in <myHandleTypeAndName>. More...
virtual void | clear ()=0
| Clear the list of handles. More...
virtual bool | empty () const =0
| Return whether the list of tools is empty. More...
virtual ConstBaseHandleArray | getBaseArray () const =0
| Get a read-only vector of const GaudiHandleBase* pointing to the real handles. More...
virtual BaseHandleArray | getBaseArray ()=0
| Get a read-write vector of GaudiHandleBase* pointing to the real handles. More...
virtual bool | retrieved () const =0
| To be able to tell if Array was ever retreived. 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...

## Protected Member Functions
| 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...

## 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 330 of file GaudiHandle.h.

## Member Typedef Documentation

## ◆ BaseHandleArray

typedef std::vector<GaudiHandleBase*> GaudiHandleArrayBase::BaseHandleArray

Definition at line 337 of file GaudiHandle.h.

## ◆ ConstBaseHandleArray

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

Definition at line 338 of file GaudiHandle.h.

## ◆ PropertyType

using GaudiHandleArrayBase::PropertyType = GaudiHandleArrayProperty

Definition at line 336 of file GaudiHandle.h.

## Constructor & Destructor Documentation

## ◆ GaudiHandleArrayBase()

GaudiHandleArrayBase::GaudiHandleArrayBase | ( | std::string | myComponentType,
|  | std::string | myParentName
| ) |  |
| inline protected

Definition at line 332 of file GaudiHandle.h.

333 : GaudiHandleInfo( std::move( myComponentType ), std::move( myParentName ) ) {}
std::move
T move(T... args)
GaudiHandleInfo::GaudiHandleInfo
GaudiHandleInfo(std::string myComponentType, std::string myParentName)
Some basic information and helper functions shared between various handles/arrays.
Definition: GaudiHandle.h:35

## Member Function Documentation

## ◆ clear()

virtual void GaudiHandleArrayBase::clear | ( |  | ) |
| pure virtual

Clear the list of handles.

Implemented in GaudiHandleArray

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

## ◆ empty()

virtual bool GaudiHandleArrayBase::empty | ( |  | ) | const
| pure virtual

Return whether the list of tools is empty.

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

## ◆ getBaseArray() [1/2]

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

## ◆ getBaseArray() [2/2]

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

## ◆ getBaseInfos()

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 61 of file GaudiHandle.cpp.

62 {
63 std::vector<std::string> theList;
64 for ( const auto& it : getBaseArray() ) theList.push_back( ( it->*pMemFunc )() );
65 return theList;
66 }
GaudiHandleArrayBase::getBaseArray
virtual ConstBaseHandleArray getBaseArray() const =0
Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
std::vector::push_back
T push_back(T... args)
std::vector< std::string >

## ◆ names()

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

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

Definition at line 74 of file GaudiHandle.cpp.

74 { return getBaseInfos( &GaudiHandleBase::name ); }
GaudiHandleBase::name
std::string name() const
The instance name: the part after the '/'.
Definition: GaudiHandle.cpp:22
GaudiHandleArrayBase::getBaseInfos
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 func...
Definition: GaudiHandle.cpp:61

## ◆ push_back()

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

## ◆ pythonPropertyClassName()

std::string GaudiHandleArrayBase::pythonPropertyClassName | ( |  | ) | const
| override 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 76 of file GaudiHandle.cpp.

76 { return componentType() + "HandleArray"; }
GaudiHandleInfo::componentType
const std::string & componentType() const
Definition: GaudiHandle.h:44

## ◆ pythonRepr()

std::string GaudiHandleArrayBase::pythonRepr | ( |  | ) | const
| override 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 78 of file GaudiHandle.cpp.

78 {
79 std::string repr = pythonPropertyClassName() + "([";
80 auto theList = typesAndNames();
81 auto first = theList.begin();
82 auto last = theList.end();
83 if ( first != last ) {
84 repr += "'" + *first + "'";
85 ++first;
86 }
87 for ( ; first != last; ++first ) repr += ",'" + *first + "'";
88 repr += "])";
89 return repr;
90 }
GaudiHandleArrayBase::typesAndNames
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
Definition: GaudiHandle.cpp:68
std::string
STL class.
GaudiHandleArrayBase::pythonPropertyClassName
std::string pythonPropertyClassName() const override
Name of the componentType with "HandleArray" appended.
Definition: GaudiHandle.cpp:76

## ◆ retrieved()

virtual bool GaudiHandleArrayBase::retrieved | ( |  | ) | const
| pure virtual

To be able to tell if Array was ever retreived.

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

## ◆ setTypesAndNames()

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 53 of file GaudiHandle.cpp.

53 {
54 clear();
55 for ( const auto& it : myTypesAndNamesList ) {
56 if ( !push_back( it ) ) return false;
57 }
58 return true;
59 }
GaudiHandleArrayBase::clear
virtual void clear()=0
Clear the list of handles.
GaudiHandleArrayBase::push_back
virtual bool push_back(const std::string &myHandleTypeAndName)=0
Add a handle to the array with "type/name" given in <myHandleTypeAndName>.

## ◆ types()

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

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

Definition at line 72 of file GaudiHandle.cpp.

72 { return getBaseInfos( &GaudiHandleBase::type ); }
GaudiHandleArrayBase::getBaseInfos
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 func...
Definition: GaudiHandle.cpp:61
GaudiHandleBase::type
std::string type() const
The concrete component class name: the part before the '/'.
Definition: GaudiHandle.cpp:11

## ◆ typesAndNames()

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 68 of file GaudiHandle.cpp.

68 {
69 return getBaseInfos( &GaudiHandleBase::typeAndName );
70 }
GaudiHandleBase::typeAndName
std::string typeAndName() const
The full type and name: "type/name".
Definition: GaudiHandle.h:115
GaudiHandleArrayBase::getBaseInfos
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 func...
Definition: GaudiHandle.cpp:61

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

- GaudiKernel/GaudiKernel/GaudiHandle.h
- GaudiKernel/src/Lib/GaudiHandle.cpp