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 180 of file PhaseIIInDetRawDataContainer.h.

Member Function Documentation

◆ beginIndex()

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

the first element in the range

Definition at line 186 of file PhaseIIInDetRawDataContainer.h.

186{ 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 190 of file PhaseIIInDetRawDataContainer.h.

190{ 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 188 of file PhaseIIInDetRawDataContainer.h.

188{ return m_endIndex; }

◆ operator==()

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

Definition at line 198 of file PhaseIIInDetRawDataContainer.h.

198 {
199 // should only be executed if the indices refer to the same range
200 // thus the cached begin index should always be identical, and
201 // comparison is limited to the minimum, which is only sufficient
202 // if the the two indices refer to the same range, which is the
203 // case when this comparison would be done as part of a range based
204 // for loop.
205 assert(m_endIndex == other.m_endIndex);
206 assert(m_beginIndex == other.m_beginIndex);
207 return m_rangeIndex == other.m_rangeIndex;
208 }
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 195 of file PhaseIIInDetRawDataContainer.h.

195{ 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 181 of file PhaseIIInDetRawDataContainer.h.

181{};

◆ m_endIndex

unsigned int PhaseII::IndexWithRange::m_endIndex {}

index after the last child element of this range

Definition at line 182 of file PhaseIIInDetRawDataContainer.h.

182{};

◆ 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 183 of file PhaseIIInDetRawDataContainer.h.

183{};

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