The Gaudi Framework  master (1a7a3838)
Loading...
Searching...
No Matches
Gaudi::DataHandleVector< Handle, T > Class Template Reference

A configurable, dynamically sized sequence of homogeneous data handles. More...

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

Inheritance diagram for Gaudi::DataHandleVector< Handle, T >:
Collaboration diagram for Gaudi::DataHandleVector< Handle, T >:

Public Member Functions

template<typename Owner>
 DataHandleVector (Owner *parent, std::string name, const std::vector< std::string > &keys, std::string doc="")
 Declare a vector data-handle property on an owning component.
template<typename Owner>
 DataHandleVector (Owner *parent, const std::pair< std::string, std::vector< std::string > > &keys)
 Construct from the property-name/default-value pair used by the Functional algorithm data-handle machinery.
template<typename Owner, typename Keys>
 DataHandleVector (std::tuple< Owner, Keys > &&keys)
 Adapt the owner/name-and-default tuple produced internally by DataHandleMixin to the public constructor.
template<typename Owner, typename Name, typename Keys>
 DataHandleVector (std::tuple< Owner, Name, Keys > &&keys)
 Adapt the owner/name/default tuple produced internally by DataHandleMixin to the public constructor.
void setKeys (std::span< const DataObjID > keys) override
 Replace the configured TES keys and their registered typed handles.
void clear ()
 Remove all configured keys and unregister their typed handles.
const std::vector< DataObjID > & keys () const override
 Configured TES keys, in property order.
const std::vector< Handle< T > > & handles () const
 Typed handles, in property order.
const DataObjIDat (std::size_t i) const
 Configured TES key at i.
auto size () const
 Number of configured handles.
DataHandle::Mode mode () const override
 Access mode shared by every contained handle.
std::string type () const override
 Demangled C++ type accessed by every contained handle.
Public Member Functions inherited from Gaudi::DataHandleVectorBase
virtual ~DataHandleVectorBase ()=default
std::string pythonPropertyClassName () const
 Python class used to represent the property value.
std::string semantics () const
 GaudiConfig2 semantics name including handle mode and value type.
std::string pythonRepr () const
 Python expression reproducing the configured value.

Protected Attributes

IDataHandleHolderm_owner = nullptr
std::vector< DataObjIDm_keys
std::vector< Handle< T > > m_handles

Additional Inherited Members

Public Types inherited from Gaudi::DataHandleVectorBase
using PropertyType = DataHandleVectorProperty

Detailed Description

template<template< typename > class Handle, typename T>
class Gaudi::DataHandleVector< Handle, T >

A configurable, dynamically sized sequence of homogeneous data handles.

Every contained handle is registered with the parent IDataHandleHolder, so schedulers see each configured location as an individual dependency.

Template Parameters
Handledata-handle template, such as DataObjectReadHandle
Tdata type accessed by every handle

Definition at line 132 of file DataHandle.h.

Constructor & Destructor Documentation

◆ DataHandleVector() [1/4]

template<template< typename > class Handle, typename T>
template<typename Owner>
Gaudi::DataHandleVector< Handle, T >::DataHandleVector ( Owner * parent,
std::string name,
const std::vector< std::string > & keys,
std::string doc = "" )
inline

Declare a vector data-handle property on an owning component.

Parameters
parentcomponent which owns the property and contained handles
nameproperty name
keysinitial sequence of TES keys
docproperty documentation

Definition at line 142 of file DataHandle.h.

143 : m_owner{ parent } {
145 ids.reserve( keys.size() );
146 for ( const auto& key : keys ) ids.emplace_back( key );
147 setKeys( ids );
148 auto p = parent->declareProperty( std::move( name ), *this, std::move( doc ) );
149 p->template setOwnerType<Owner>();
150 }
A configurable, dynamically sized sequence of homogeneous data handles.
Definition DataHandle.h:132
IDataHandleHolder * m_owner
Definition DataHandle.h:205
void setKeys(std::span< const DataObjID > keys) override
Replace the configured TES keys and their registered typed handles.
Definition DataHandle.h:180
const std::vector< DataObjID > & keys() const override
Configured TES keys, in property order.
Definition DataHandle.h:191

◆ DataHandleVector() [2/4]

template<template< typename > class Handle, typename T>
template<typename Owner>
Gaudi::DataHandleVector< Handle, T >::DataHandleVector ( Owner * parent,
const std::pair< std::string, std::vector< std::string > > & keys )
inline

Construct from the property-name/default-value pair used by the Functional algorithm data-handle machinery.

Parameters
parentcomponent which owns the property and contained handles
keysproperty name and initial sequence of TES keys

Definition at line 159 of file DataHandle.h.

160 : DataHandleVector{ parent, keys.first, keys.second } {}
DataHandleVector(Owner *parent, std::string name, const std::vector< std::string > &keys, std::string doc="")
Declare a vector data-handle property on an owning component.
Definition DataHandle.h:142

◆ DataHandleVector() [3/4]

template<template< typename > class Handle, typename T>
template<typename Owner, typename Keys>
Gaudi::DataHandleVector< Handle, T >::DataHandleVector ( std::tuple< Owner, Keys > && keys)
inline

Adapt the owner/name-and-default tuple produced internally by DataHandleMixin to the public constructor.

Parameters
keysowner followed by a property-name/default-value pair

Definition at line 168 of file DataHandle.h.

◆ DataHandleVector() [4/4]

template<template< typename > class Handle, typename T>
template<typename Owner, typename Name, typename Keys>
Gaudi::DataHandleVector< Handle, T >::DataHandleVector ( std::tuple< Owner, Name, Keys > && keys)
inline

Adapt the owner/name/default tuple produced internally by DataHandleMixin to the public constructor.

Parameters
keysowner, property name, and initial sequence of TES keys

Definition at line 176 of file DataHandle.h.

Member Function Documentation

◆ at()

template<template< typename > class Handle, typename T>
const DataObjID & Gaudi::DataHandleVector< Handle, T >::at ( std::size_t i) const
inline

Configured TES key at i.

Definition at line 195 of file DataHandle.h.

195{ return m_keys.at( i ); }
std::vector< DataObjID > m_keys
Definition DataHandle.h:206

◆ clear()

template<template< typename > class Handle, typename T>
void Gaudi::DataHandleVector< Handle, T >::clear ( )
inline

Remove all configured keys and unregister their typed handles.

Definition at line 188 of file DataHandle.h.

◆ handles()

template<template< typename > class Handle, typename T>
const std::vector< Handle< T > > & Gaudi::DataHandleVector< Handle, T >::handles ( ) const
inline

Typed handles, in property order.

Definition at line 193 of file DataHandle.h.

193{ return m_handles; }
std::vector< Handle< T > > m_handles
Definition DataHandle.h:207

◆ keys()

template<template< typename > class Handle, typename T>
const std::vector< DataObjID > & Gaudi::DataHandleVector< Handle, T >::keys ( ) const
inlineoverridevirtual

Configured TES keys, in property order.

Implements Gaudi::DataHandleVectorBase.

Definition at line 191 of file DataHandle.h.

191{ return m_keys; }

◆ mode()

template<template< typename > class Handle, typename T>
DataHandle::Mode Gaudi::DataHandleVector< Handle, T >::mode ( ) const
inlineoverridevirtual

Access mode shared by every contained handle.

Implements Gaudi::DataHandleVectorBase.

Definition at line 200 of file DataHandle.h.

200{ return Handle<T>::mode_v; }

◆ setKeys()

template<template< typename > class Handle, typename T>
void Gaudi::DataHandleVector< Handle, T >::setKeys ( std::span< const DataObjID > keys)
inlineoverridevirtual

Replace the configured TES keys and their registered typed handles.

Implements Gaudi::DataHandleVectorBase.

Definition at line 180 of file DataHandle.h.

180 {
181 m_keys.assign( keys.begin(), keys.end() );
182 m_handles.clear();
183 m_handles.reserve( m_keys.size() );
184 for ( const auto& key : m_keys ) m_handles.emplace_back( key, m_owner );
185 }

◆ size()

template<template< typename > class Handle, typename T>
auto Gaudi::DataHandleVector< Handle, T >::size ( ) const
inline

Number of configured handles.

Definition at line 197 of file DataHandle.h.

197{ return m_handles.size(); }

◆ type()

template<template< typename > class Handle, typename T>
std::string Gaudi::DataHandleVector< Handle, T >::type ( ) const
inlineoverridevirtual

Demangled C++ type accessed by every contained handle.

Implements Gaudi::DataHandleVectorBase.

Definition at line 202 of file DataHandle.h.

202{ return System::typeinfoName( typeid( T ) ); }
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition System.cpp:254

Member Data Documentation

◆ m_handles

template<template< typename > class Handle, typename T>
std::vector<Handle<T> > Gaudi::DataHandleVector< Handle, T >::m_handles
protected

Definition at line 207 of file DataHandle.h.

◆ m_keys

template<template< typename > class Handle, typename T>
std::vector<DataObjID> Gaudi::DataHandleVector< Handle, T >::m_keys
protected

Definition at line 206 of file DataHandle.h.

◆ m_owner

template<template< typename > class Handle, typename T>
IDataHandleHolder* Gaudi::DataHandleVector< Handle, T >::m_owner = nullptr
protected

Definition at line 205 of file DataHandle.h.


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