ATLAS Offline Software
Loading...
Searching...
No Matches
PhaseII::IndexWithRange Struct Reference

Helper class to be used in conjunction with ProxyContainers. More...

#include <PhaseIIInDetRawDataContainer.h>

Collaboration diagram for PhaseII::IndexWithRange:

Public Member Functions

unsigned int beginIndex () const
 the first element in the range
unsigned int endIndex () const
 the index of the element after the last element
bool empty () const
 return true if this range does not contain any elements.
const unsigned int & rangeIndex () const
 the index which identifies this range within its parent.
bool operator== (const IndexWithRange &other) const

Public Attributes

unsigned int m_beginIndex {}
 index of the first child element in the range
unsigned int m_endIndex {}
 index after the last child element of this range
unsigned int m_rangeIndex {}
 the index if the element which is the parent of the children where the index may refer to a different container

Detailed Description

Helper class to be used in conjunction with ProxyContainers.

The class provides a range of child elements and for debugging purposes also caches the element index of the element which is parent to these child elements. This class can be used by a proxy container to implement the necessary methods for iterating over child elements.

Definition at line 209 of file PhaseIIInDetRawDataContainer.h.

Member Function Documentation

◆ beginIndex()

unsigned int PhaseII::IndexWithRange::beginIndex ( ) const
inline

the first element in the range

Definition at line 215 of file PhaseIIInDetRawDataContainer.h.

215{ return m_beginIndex; }
unsigned int m_beginIndex
index of the first child element in the range

◆ empty()

bool PhaseII::IndexWithRange::empty ( ) const
inline

return true if this range does not contain any elements.

Definition at line 219 of file PhaseIIInDetRawDataContainer.h.

219{ return m_endIndex == m_beginIndex; }
unsigned int m_endIndex
index after the last child element of this range

◆ endIndex()

unsigned int PhaseII::IndexWithRange::endIndex ( ) const
inline

the index of the element after the last element

Definition at line 217 of file PhaseIIInDetRawDataContainer.h.

217{ return m_endIndex; }

◆ operator==()

bool PhaseII::IndexWithRange::operator== ( const IndexWithRange & other) const
inline

Definition at line 227 of file PhaseIIInDetRawDataContainer.h.

227 {
228 // should only be executed if the indices refer to the same range
229 // thus the cached begin index should always be identical, and
230 // comparison is limited to the minimum, which is only sufficient
231 // if the the two indices refer to the same range, which is the
232 // case when this comparison would be done as part of a range based
233 // for loop.
234 assert(m_endIndex == other.m_endIndex);
235 assert(m_beginIndex == other.m_beginIndex);
236 return m_rangeIndex == other.m_rangeIndex;
237 }
unsigned int m_rangeIndex
the index if the element which is the parent of the children where the index may refer to a different...

◆ rangeIndex()

const unsigned int & PhaseII::IndexWithRange::rangeIndex ( ) const
inline

the index which identifies this range within its parent.

For example if this range represents the hits of a module, this could be the identifier hash.

Definition at line 224 of file PhaseIIInDetRawDataContainer.h.

224{ return m_rangeIndex; }

Member Data Documentation

◆ m_beginIndex

unsigned int PhaseII::IndexWithRange::m_beginIndex {}

index of the first child element in the range

Definition at line 210 of file PhaseIIInDetRawDataContainer.h.

210{};

◆ m_endIndex

unsigned int PhaseII::IndexWithRange::m_endIndex {}

index after the last child element of this range

Definition at line 211 of file PhaseIIInDetRawDataContainer.h.

211{};

◆ m_rangeIndex

unsigned int PhaseII::IndexWithRange::m_rangeIndex {}

the index if the element which is the parent of the children where the index may refer to a different container

Definition at line 212 of file PhaseIIInDetRawDataContainer.h.

212{};

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