ATLAS Offline Software
Loading...
Searching...
No Matches
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE > Class Template Referenceabstract

#include <HandleKeyArray.h>

Inheritance diagram for SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >:
Collaboration diagram for SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >:

Public Member Functions

 HandleKeyArray ()
 default Constructor from a HandleKeyArray
 HandleKeyArray (const std::vector< T_HandleKey > &v)
 Constructor from a HandleKeyArray that takes a vector of ReadHandleKeys.
 HandleKeyArray (std::initializer_list< T_HandleKey > l)
 Constructor from a HandleKeyArray that takes an initializer list of HandleKeys.
 HandleKeyArray (std::initializer_list< std::string > key_names)
 Constructor from a HandleKeyArray that takes an initializer list of std::strings.
template<class T = T_HandleKey>
requires T::isDecorHandleKey
 HandleKeyArray (VarHandleKey &contKey, std::initializer_list< std::string > key_names)
 base Constructor that takes an associated container and an initializer list of std::strings.
template<std::derived_from< IProperty > OWNER>
 HandleKeyArray (OWNER *owner, std::string name, std::initializer_list< std::string > l, std::string doc="")
 auto-declaring Property Constructor from a HandleKeyArray that takes an initializer list of std::strings, and associates the WHKA with the specified Property name
template<std::derived_from< IProperty > OWNER, class T = T_HandleKey>
requires T::isDecorHandleKey
 HandleKeyArray (OWNER *owner, std::string name, VarHandleKey &contKey, std::initializer_list< std::string > l, std::string doc="")
 auto-declaring Property Constructor from a HandleKeyArray that takes an initializer list of std::strings, and associates the WHKA with the specified Property name
virtual Gaudi::DataHandle::Mode mode () const override
 return the type (Read/Write/Update) of handle
std::vector< T_Handle > makeHandles () const
 create a vector of Handles from the HandleKeys in the array
std::vector< T_Handle > makeHandles (const EventContext &ctx) const
 create a vector of Handles from the HandleKeys in the array, with explicit EventContext.
StatusCode initialize (bool used=true)
 forward the initialization to the member VarHandleKeys
virtual StatusCode assign (const std::vector< std::string > &vs) override
 Set the contents of the VarHandleKeyArray from a vector of std::strings.
virtual void push_back (const std::string &key) override
 Add a new key to the VarHandleKeyArray.
virtual std::string toString () const override
 string representation of the VarHandleKeyArray
virtual std::vector< SG::VarHandleKey * > keys () const override
 create array of all base VarHandleKeys in the Array
virtual void renounce () override
 if called, handles will not be declared in the algorithm I/O
virtual bool renounced () const override
 query renounced state
virtual void declare (IDataHandleHolder *) override
virtual void setOwner (IDataHandleHolder *o) override
virtual const IDataHandleHolder * owner () const override
virtual IDataHandleHolder * owner ()=0

Public Attributes

elements
 STL member.

Private Member Functions

T_HandleKey keyFromString (const std::string &s) const
 Create a HandleKey from a string.

Private Attributes

bool m_isRenounced
IDataHandleHolder * m_owner
const VarHandleKeym_contKey
 Optional container on which decorations are applied.

Detailed Description

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
class SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >

Definition at line 45 of file StoreGate/StoreGate/HandleKeyArray.h.

Constructor & Destructor Documentation

◆ HandleKeyArray() [1/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( )
inline

default Constructor from a HandleKeyArray

Definition at line 50 of file StoreGate/StoreGate/HandleKeyArray.h.

50{}

◆ HandleKeyArray() [2/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( const std::vector< T_HandleKey > & v)
inline

Constructor from a HandleKeyArray that takes a vector of ReadHandleKeys.

Parameters
vvector of HandleKey

Definition at line 57 of file StoreGate/StoreGate/HandleKeyArray.h.

◆ HandleKeyArray() [3/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( std::initializer_list< T_HandleKey > l)
inline

Constructor from a HandleKeyArray that takes an initializer list of HandleKeys.

Parameters
linitializer list of HandleKey

Definition at line 65 of file StoreGate/StoreGate/HandleKeyArray.h.

◆ HandleKeyArray() [4/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( std::initializer_list< std::string > key_names)
inline

Constructor from a HandleKeyArray that takes an initializer list of std::strings.

Parameters
linitializer list of std::strings used to create the HandleKeys

Definition at line 74 of file StoreGate/StoreGate/HandleKeyArray.h.

◆ HandleKeyArray() [5/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
template<class T = T_HandleKey>
requires T::isDecorHandleKey
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( VarHandleKey & contKey,
std::initializer_list< std::string > key_names )
inline

base Constructor that takes an associated container and an initializer list of std::strings.

Parameters
contKeyVarHandleKey of the associated container
linitializer list of std::strings used to create the VarHandleKeys

All decorations will be read from the container referenced by @contKey.

Definition at line 89 of file StoreGate/StoreGate/HandleKeyArray.h.

◆ HandleKeyArray() [6/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
template<std::derived_from< IProperty > OWNER>
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( OWNER * owner,
std::string name,
std::initializer_list< std::string > l,
std::string doc = "" )
inline

auto-declaring Property Constructor from a HandleKeyArray that takes an initializer list of std::strings, and associates the WHKA with the specified Property name

Parameters
namename of Property
linitializer list of std::strings used to create the HandleKeys
docdocumentation string

Definition at line 103 of file StoreGate/StoreGate/HandleKeyArray.h.

106 :
108 auto p = owner->declareProperty(std::move(name), *this, std::move(doc));
109 p->template setOwnerType<OWNER>();
110 }
virtual const IDataHandleHolder * owner() const =0

◆ HandleKeyArray() [7/7]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
template<std::derived_from< IProperty > OWNER, class T = T_HandleKey>
requires T::isDecorHandleKey
SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::HandleKeyArray ( OWNER * owner,
std::string name,
VarHandleKey & contKey,
std::initializer_list< std::string > l,
std::string doc = "" )
inline

auto-declaring Property Constructor from a HandleKeyArray that takes an initializer list of std::strings, and associates the WHKA with the specified Property name

Parameters
namename of Property
contKeyVarHandleKey of the associated container
linitializer list of std::strings used to create the HandleKeys
docdocumentation string

All decorations will be read from the container referenced by @contKey.

Definition at line 128 of file StoreGate/StoreGate/HandleKeyArray.h.

132 :
134 auto p = owner->declareProperty(std::move(name), *this, std::move(doc));
135 p->template setOwnerType<OWNER>();
136 }

Member Function Documentation

◆ assign()

virtual StatusCode SG::VarHandleKeyArrayCommon< T_HandleKey >::assign ( const std::vector< std::string > & vs)
overridevirtualinherited

Set the contents of the VarHandleKeyArray from a vector of std::strings.

Parameters
vsvector of initializer strings

Implements SG::VarHandleKeyArray.

◆ declare()

virtual void SG::VarHandleKeyArrayCommon< T_HandleKey >::declare ( IDataHandleHolder * )
overridevirtualinherited

Implements SG::VarHandleKeyArray.

◆ initialize()

StatusCode SG::VarHandleKeyArrayCommon< T_HandleKey >::initialize ( bool used = true)
inherited

forward the initialization to the member VarHandleKeys

Parameters
usedIf false, then this handle is not to be used. Instead of normal initialization, the key will be cleared.

◆ keyFromString()

T_HandleKey SG::VarHandleKeyArrayCommon< T_HandleKey >::keyFromString ( const std::string & s) const
privateinherited

Create a HandleKey from a string.

Parameters
sString from which to create the HandleKey.

This is for decoration handle keys. If this array was initialized with a container key, then that will be used to for the handle keys.

◆ keys()

virtual std::vector< SG::VarHandleKey * > SG::VarHandleKeyArrayCommon< T_HandleKey >::keys ( ) const
overridevirtualinherited

create array of all base VarHandleKeys in the Array

Implements SG::VarHandleKeyArray.

◆ makeHandles() [1/2]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
std::vector< T_Handle > SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::makeHandles ( ) const
inline

create a vector of Handles from the HandleKeys in the array

Definition at line 148 of file StoreGate/StoreGate/HandleKeyArray.h.

148 {
151 for (const T_HandleKey& k : *this) {
152 hndl.emplace_back ( k, ctx );
153 }
154 return hndl;
155 }

◆ makeHandles() [2/2]

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
std::vector< T_Handle > SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::makeHandles ( const EventContext & ctx) const
inline

create a vector of Handles from the HandleKeys in the array, with explicit EventContext.

Definition at line 161 of file StoreGate/StoreGate/HandleKeyArray.h.

162 {
164 for (const T_HandleKey& k : *this) {
165 hndl.emplace_back ( k, ctx);
166 }
167 return hndl;
168 }

◆ mode()

template<class T_Handle, class T_HandleKey, Gaudi::DataHandle::Mode MODE>
virtual Gaudi::DataHandle::Mode SG::HandleKeyArray< T_Handle, T_HandleKey, MODE >::mode ( ) const
inlineoverridevirtual

return the type (Read/Write/Update) of handle

Implements SG::VarHandleKeyArray.

Definition at line 142 of file StoreGate/StoreGate/HandleKeyArray.h.

142{ return MODE; }

◆ owner() [1/2]

virtual IDataHandleHolder * SG::VarHandleKeyArray::owner ( )
pure virtualinherited

◆ owner() [2/2]

virtual const IDataHandleHolder * SG::VarHandleKeyArrayCommon< T_HandleKey >::owner ( ) const
inlineoverridevirtualinherited

◆ push_back()

virtual void SG::VarHandleKeyArrayCommon< T_HandleKey >::push_back ( const std::string & key)
inlineoverridevirtualinherited

Add a new key to the VarHandleKeyArray.

Parameters
keyname of the key

Implements SG::VarHandleKeyArray.

Definition at line 135 of file StoreGate/StoreGate/VarHandleKeyArray.h.

135 {
137 }
T_HandleKey keyFromString(const std::string &s) const

◆ renounce()

virtual void SG::VarHandleKeyArrayCommon< T_HandleKey >::renounce ( )
inlineoverridevirtualinherited

if called, handles will not be declared in the algorithm I/O

Implements SG::VarHandleKeyArray.

Definition at line 153 of file StoreGate/StoreGate/VarHandleKeyArray.h.

153{ m_isRenounced = true; }

◆ renounced()

virtual bool SG::VarHandleKeyArrayCommon< T_HandleKey >::renounced ( ) const
inlineoverridevirtualinherited

query renounced state

Implements SG::VarHandleKeyArray.

Definition at line 158 of file StoreGate/StoreGate/VarHandleKeyArray.h.

158{ return m_isRenounced; }

◆ setOwner()

virtual void SG::VarHandleKeyArrayCommon< T_HandleKey >::setOwner ( IDataHandleHolder * o)
inlineoverridevirtualinherited

Implements SG::VarHandleKeyArray.

Definition at line 162 of file StoreGate/StoreGate/VarHandleKeyArray.h.

162{ m_owner = o; }

◆ toString()

virtual std::string SG::VarHandleKeyArrayCommon< T_HandleKey >::toString ( ) const
overridevirtualinherited

string representation of the VarHandleKeyArray

Implements SG::VarHandleKeyArray.

Member Data Documentation

◆ elements

T std::vector< T >::elements
inherited

STL member.

◆ m_contKey

const VarHandleKey* SG::VarHandleKeyArrayCommon< T_HandleKey >::m_contKey
privateinherited

Optional container on which decorations are applied.

Definition at line 194 of file StoreGate/StoreGate/VarHandleKeyArray.h.

◆ m_isRenounced

bool SG::VarHandleKeyArrayCommon< T_HandleKey >::m_isRenounced
privateinherited

Definition at line 190 of file StoreGate/StoreGate/VarHandleKeyArray.h.

190{ false };

◆ m_owner

IDataHandleHolder* SG::VarHandleKeyArrayCommon< T_HandleKey >::m_owner
privateinherited

Definition at line 191 of file StoreGate/StoreGate/VarHandleKeyArray.h.

191{ nullptr };

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