ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T > Class Template Reference

#include <JaggedVecEltCache.h>

Collaboration diagram for xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >:

Public Member Functions

 JaggedVecEltCache (SG::AuxVectorData &cont, const SG::Accessor< SG::JaggedVecElt< T > > &accessor, unsigned int n)
unsigned int getBeginIndex (unsigned int obj_i) const
unsigned int getEndIndex (unsigned int obj_i) const
void setValue (unsigned int elm_i, T &&value)
void setValue (unsigned int elm_i, const T &value)
void updateEndIndex (unsigned int obj_i, unsigned int elm_i)
std::size_t nObjects () const
std::size_t nElements () const

Private Attributes

SG::Accessor< SG::JaggedVecElt< T > >::Elt_span m_elt
SG::Accessor< SG::JaggedVecElt< T > >::Payload_span m_payload

Detailed Description

template<typename T>
class xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >

Definition at line 8 of file JaggedVecEltCache.h.

Constructor & Destructor Documentation

◆ JaggedVecEltCache()

template<typename T>
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::JaggedVecEltCache ( SG::AuxVectorData & cont,
const SG::Accessor< SG::JaggedVecElt< T > > & accessor,
unsigned int n )
inline

Definition at line 10 of file JaggedVecEltCache.h.

10 {
11 if (n>0) {
12 assert(cont.getStore());
13 cont.getStore()->getData(accessor.linkedAuxid(),n, n);
14 m_elt = accessor.getEltSpan(cont);
15 m_payload = accessor.getPayloadSpan(cont);
16 }
17 }
SG::Accessor< SG::JaggedVecElt< T > >::Payload_span m_payload
SG::Accessor< SG::JaggedVecElt< T > >::Elt_span m_elt

Member Function Documentation

◆ getBeginIndex()

template<typename T>
unsigned int xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::getBeginIndex ( unsigned int obj_i) const
inline

Definition at line 18 of file JaggedVecEltCache.h.

18 {
19 assert(obj_i==0 || obj_i-1 < m_elt.size());
20 return obj_i>0 ? m_elt[obj_i-1].end() : 0u;
21 }

◆ getEndIndex()

template<typename T>
unsigned int xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::getEndIndex ( unsigned int obj_i) const
inline

Definition at line 22 of file JaggedVecEltCache.h.

22 {
23 assert(obj_i < m_elt.size());
24 return m_elt[obj_i].end();
25 }

◆ nElements()

template<typename T>
std::size_t xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::nElements ( ) const
inline

Definition at line 40 of file JaggedVecEltCache.h.

40{ return m_payload.size(); };

◆ nObjects()

template<typename T>
std::size_t xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::nObjects ( ) const
inline

Definition at line 39 of file JaggedVecEltCache.h.

39{ return m_elt.size(); };

◆ setValue() [1/2]

template<typename T>
void xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::setValue ( unsigned int elm_i,
const T & value )
inline

Definition at line 30 of file JaggedVecEltCache.h.

30 {
31 assert(elm_i<m_payload.size());
33 }

◆ setValue() [2/2]

template<typename T>
void xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::setValue ( unsigned int elm_i,
T && value )
inline

Definition at line 26 of file JaggedVecEltCache.h.

26 {
27 assert(elm_i<m_payload.size());
29 }

◆ updateEndIndex()

template<typename T>
void xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::updateEndIndex ( unsigned int obj_i,
unsigned int elm_i )
inline

Definition at line 34 of file JaggedVecEltCache.h.

34 {
35 assert(elm_i<=m_payload.size());
36 assert(obj_i<m_elt.size());
38 }

Member Data Documentation

◆ m_elt

template<typename T>
SG::Accessor<SG::JaggedVecElt<T>>::Elt_span xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::m_elt
private

Definition at line 42 of file JaggedVecEltCache.h.

◆ m_payload

template<typename T>
SG::Accessor<SG::JaggedVecElt<T>>::Payload_span xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< T >::m_payload
private

Definition at line 43 of file JaggedVecEltCache.h.


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