The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
GaudiHandleArrayBase Class Referenceabstract

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

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/GaudiHandle.h>

Inheritance diagram for GaudiHandleArrayBase:
Collaboration diagram for GaudiHandleArrayBase:

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>.
 
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 (auto(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.
 
std::string pythonPropertyClassName () const override
 Name of the componentType with "HandleArray" appended.
 
std::string pythonRepr () const override
 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.
 
virtual StatusCode retrieve ()=0
 Retrieve all tools.
 
virtual StatusCode release ()=0
 Release all tools.
 
virtual bool retrieved () const =0
 To be able to tell if Array was ever retreived.
 
- Public Member Functions inherited from GaudiHandleInfo
virtual ~GaudiHandleInfo ()
 virtual destructor so that derived class destructor is called.
 
const std::string & componentType () const
 
const std::string & propertyName () const
 name as used in declareProperty(name,gaudiHandle)
 
void setPropertyName (std::string propName)
 set name as used in declareProperty(name,gaudiHandle).
 
const std::string & parentName () const
 The name of the parent.
 

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.
 
void setComponentType (std::string componentType)
 The component type.
 
void setParentName (std::string parent)
 The name of the parent.
 

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

Member Typedef Documentation

◆ BaseHandleArray

Definition at line 341 of file GaudiHandle.h.

◆ ConstBaseHandleArray

Definition at line 342 of file GaudiHandle.h.

◆ PropertyType

Constructor & Destructor Documentation

◆ GaudiHandleArrayBase()

GaudiHandleArrayBase::GaudiHandleArrayBase ( std::string myComponentType,
std::string myParentName )
inlineprotected

Definition at line 336 of file GaudiHandle.h.

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

Member Function Documentation

◆ clear()

◆ empty()

virtual bool GaudiHandleArrayBase::empty ( ) const
pure virtual

◆ getBaseArray() [1/2]

virtual ConstBaseHandleArray GaudiHandleArrayBase::getBaseArray ( ) const
pure virtual

◆ getBaseArray() [2/2]

virtual BaseHandleArray GaudiHandleArrayBase::getBaseArray ( )
pure virtual

◆ getBaseInfos()

const std::vector< std::string > GaudiHandleArrayBase::getBaseInfos ( auto(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.

Definition at line 71 of file GaudiHandle.cpp.

71 {
72 std::vector<std::string> theList;
73 for ( const auto& it : getBaseArray() ) theList.push_back( ( it->*pMemFunc )() );
74 return theList;
75}
virtual ConstBaseHandleArray getBaseArray() const =0
Get a read-only vector of const GaudiHandleBase* pointing to the real handles.

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

const std::vector< std::string > getBaseInfos(auto(GaudiHandleBase::*pMemFunc)() const) const
Helper function to get a vector of strings filled with the return value of each tool of a member func...
std::string name() const
The instance name: the part after the '/'.

◆ push_back()

virtual bool GaudiHandleArrayBase::push_back ( const std::string & myHandleTypeAndName)
pure virtual

◆ pythonPropertyClassName()

std::string GaudiHandleArrayBase::pythonPropertyClassName ( ) const
overridevirtual

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

85{ return componentType() + "HandleArray"; }
const std::string & componentType() const
Definition GaudiHandle.h:53

◆ pythonRepr()

std::string GaudiHandleArrayBase::pythonRepr ( ) const
overridevirtual

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

87 {
88 std::string repr = pythonPropertyClassName() + "([";
89 auto theList = typesAndNames();
90 auto first = theList.begin();
91 auto last = theList.end();
92 if ( first != last ) {
93 repr += "'" + *first + "'";
94 ++first;
95 }
96 for ( ; first != last; ++first ) repr += ",'" + *first + "'";
97 repr += "])";
98 return repr;
99}
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
std::string pythonPropertyClassName() const override
Name of the componentType with "HandleArray" appended.

◆ release()

◆ retrieve()

◆ retrieved()

virtual bool GaudiHandleArrayBase::retrieved ( ) const
pure virtual

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

63 {
64 clear();
65 for ( const auto& it : myTypesAndNamesList ) {
66 if ( !push_back( it ) ) return false;
67 }
68 return true;
69}
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.

◆ types()

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

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

Definition at line 81 of file GaudiHandle.cpp.

std::string type() const
The concrete component class name: the part before the '/'.

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

77 {
79}
const std::string & typeAndName() const
The full type and name: "type/name".

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