The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
PublicToolHandleArray< T > Class Template Reference

Helper class to construct ToolHandle instances for public tools via the auto registering constructor. More...

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

Inheritance diagram for PublicToolHandleArray< T >:
Collaboration diagram for PublicToolHandleArray< T >:

Public Member Functions

 PublicToolHandleArray (bool createIf=true)
 
 PublicToolHandleArray (const std::vector< std::string > &typesAndNames, bool createIf=true)
 
template<std::derived_from< IProperty > OWNER>
 PublicToolHandleArray (OWNER *owner, std::string name, const std::vector< std::string > &typesAndNames={}, std::string doc="")
 Autodeclaring constructor with property name, tool type/name and documentation.
 
- Public Member Functions inherited from ToolHandleArray< T >
 ToolHandleArray (const std::vector< std::string > &myTypesAndNames, const IInterface *parent=nullptr, bool createIf=true)
 Generic constructor.
 
 ToolHandleArray (const IInterface *parent=nullptr, bool createIf=true)
 Constructor which creates and empty list.
 
bool push_back (const std::string &toolTypeAndName) override
 Add a handle to the array with given tool type and name.
 
bool push_back (const ToolHandle< T > &myHandle) override
 Ensure that for added handles the parent and creatIf are taken from this array.
 
template<std::derived_from< IProperty > OWNER>
 ToolHandleArray (OWNER *owner, std::string name, const std::vector< std::string > &typesAndNames={}, std::string doc="")
 Autodeclaring constructor with property name, tool type/name and documentation.
 
- Public Member Functions inherited from ToolHandleInfo
virtual ~ToolHandleInfo ()=default
 
bool isPublic () const noexcept
 
bool createIf () const noexcept
 
const IInterfaceparent () const noexcept
 
- Public Member Functions inherited from GaudiHandleArray< ToolHandle< T > >
GaudiHandleArrayoperator= (const std::vector< std::string > &myTypesAndNamesList)
 Set the array of GaudiHandles from typeAndNames given in vector of strings.
 
GaudiHandleArrayBase::BaseHandleArray getBaseArray () override
 Get a read-write vector of GaudiHandleBase* pointing to the real handles.
 
GaudiHandleArrayBase::ConstBaseHandleArray getBaseArray () const override
 Get a read-only vector of const GaudiHandleBase* pointing to the real handles.
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator rbegin () const
 
const_iterator rend () const
 
size_type size () const
 
void clear () override
 Clear the list of handles.
 
bool empty () const override
 Return whether the list of tools is empty.
 
T & operator[] (int index)
 
const T & operator[] (int index) const
 
T * operator[] (std::string_view name)
 Get pointer (!) to ToolHandle by instance name.
 
const T * operator[] (std::string_view name) const
 Get const pointer (!) to ToolHandle by instance name.
 
virtual bool push_back (const T &myHandle)
 
StatusCode retrieve () override
 Retrieve all tools.
 
StatusCode release () override
 Release all tools.
 
virtual bool retrieved () const override
 has Array been retreived?
 
- 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>.
 
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.
 
- 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.
 

Additional Inherited Members

- Public Types inherited from GaudiHandleArray< ToolHandle< T > >
typedef std::vector< T > HandleVector
 
typedef HandleVector::value_type value_type
 
typedef HandleVector::size_type size_type
 
typedef HandleVector::reference reference
 
typedef HandleVector::const_reference const_reference
 
typedef HandleVector::iterator iterator
 
typedef HandleVector::const_iterator const_iterator
 
typedef HandleVector::reverse_iterator reverse_iterator
 
typedef HandleVector::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from GaudiHandleArrayBase
using PropertyType = GaudiHandleArrayProperty
 
typedef std::vector< GaudiHandleBase * > BaseHandleArray
 
typedef std::vector< const GaudiHandleBase * > ConstBaseHandleArray
 
- Static Public Member Functions inherited from ToolHandleInfo
static std::string toolComponentType (const IInterface *parent)
 
static std::string toolParentName (const IInterface *parent)
 
- Protected Member Functions inherited from ToolHandleInfo
 ToolHandleInfo (const IInterface *parent=nullptr, bool createIf=true)
 
- Protected Member Functions inherited from GaudiHandleArray< ToolHandle< T > >
 GaudiHandleArray (const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
 Generic constructor.
 
 GaudiHandleArray (const std::string &myComponentType, const std::string &myParentName)
 Constructor creating an empty array.
 
- Protected Member Functions inherited from GaudiHandleArrayBase
 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.
 
- Protected Attributes inherited from ToolHandleInfo
const IInterfacem_parent = nullptr
 
bool m_createIf { true }
 

Detailed Description

template<class T>
class PublicToolHandleArray< T >

Helper class to construct ToolHandle instances for public tools via the auto registering constructor.

Definition at line 459 of file ToolHandle.h.

Constructor & Destructor Documentation

◆ PublicToolHandleArray() [1/3]

template<class T>
PublicToolHandleArray< T >::PublicToolHandleArray ( bool createIf = true)
inline

Definition at line 461 of file ToolHandle.h.

461: ToolHandleArray<T>( nullptr, createIf ) {}
ToolHandleArray(const std::vector< std::string > &myTypesAndNames, const IInterface *parent=nullptr, bool createIf=true)
Generic constructor.
Definition ToolHandle.h:410
bool createIf() const noexcept
Definition ToolHandle.h:51

◆ PublicToolHandleArray() [2/3]

template<class T>
PublicToolHandleArray< T >::PublicToolHandleArray ( const std::vector< std::string > & typesAndNames,
bool createIf = true )
inline

Definition at line 462 of file ToolHandle.h.

const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.

◆ PublicToolHandleArray() [3/3]

template<class T>
template<std::derived_from< IProperty > OWNER>
PublicToolHandleArray< T >::PublicToolHandleArray ( OWNER * owner,
std::string name,
const std::vector< std::string > & typesAndNames = {},
std::string doc = "" )
inline

Autodeclaring constructor with property name, tool type/name and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 468 of file ToolHandle.h.

468 {},
469 std::string doc = "" )
471 owner->addToolsArray( *this );
473 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( name ), *this, std::move( doc ) );
474 p->template setOwnerType<OWNER>();
475 }
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
Helper class to construct ToolHandle instances for public tools via the auto registering constructor.
Definition ToolHandle.h:459
PublicToolHandleArray(bool createIf=true)
Definition ToolHandle.h:461

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