Belle II Software light-2405-quaxo
Const::DetectorSet::Iterator Class Reference

Iterator. More...

#include <Const.h>

Public Member Functions

 Iterator (int index, uint16_t detectorSetBits, uint16_t setBit)
 Constructor.
 
 ~Iterator ()
 Destructor.
 
Iteratoroperator++ ()
 Operator ++.
 
void increment ()
 Increment.
 
EDetector operator* () const
 Operator *.
 
EDetector getDetector () const
 Get detector.
 
bool operator== (const Iterator &iterator)
 Operator ==.
 
bool operator!= (const Iterator &iterator)
 Operator !=.
 
int getIndex () const
 Get index.
 
uint16_t getSetBit () const
 Get set bit.
 

Private Attributes

int m_Index
 Index.
 
uint16_t m_DetectorSetBits
 Bits in DetectorSet.
 
uint16_t m_SetBit
 Set bit.
 

Detailed Description

Iterator.

Definition at line 77 of file Const.h.

Constructor & Destructor Documentation

◆ Iterator()

Iterator ( int  index,
uint16_t  detectorSetBits,
uint16_t  setBit 
)
inline

Constructor.

Parameters
[in]indexIndex.
[in]detectorSetBitsBits in DetectorSet.
[in]setBitSet bit.

Definition at line 87 of file Const.h.

87 :
88 m_Index(index),
89 m_DetectorSetBits(detectorSetBits),
90 m_SetBit(setBit)
91 {
92 }
uint16_t m_DetectorSetBits
Bits in DetectorSet.
Definition: Const.h:162

◆ ~Iterator()

~Iterator ( )
inline

Destructor.

Definition at line 97 of file Const.h.

98 {
99 }

Member Function Documentation

◆ getDetector()

EDetector getDetector ( ) const
inline

Get detector.

Definition at line 125 of file Const.h.

126 {
127 return *(*this);
128 }

◆ getIndex()

int getIndex ( ) const
inline

Get index.

Definition at line 143 of file Const.h.

144 {
145 return m_Index;
146 }

◆ getSetBit()

uint16_t getSetBit ( ) const
inline

Get set bit.

Definition at line 151 of file Const.h.

152 {
153 return m_SetBit;
154 }

◆ increment()

void increment ( )
inline

Increment.

Definition at line 109 of file Const.h.

110 {
111 ++(*this);
112 }

◆ operator!=()

bool operator!= ( const Iterator iterator)

Operator !=.

Definition at line 203 of file UnitConst.cc.

205{
206 return m_SetBit != iterator.m_SetBit;
207}

◆ operator*()

EDetector operator* ( ) const
inline

Operator *.

Definition at line 117 of file Const.h.

118 {
120 }
static EDetector getDetector(uint16_t bit)
Conversion of bit pattern to detector ID.
Definition: UnitConst.cc:259

◆ operator++()

Const::DetectorSet::Iterator & operator++ ( )

Operator ++.

Definition at line 182 of file UnitConst.cc.

183{
184 while (1) {
185 m_SetBit = m_SetBit << 1;
186 if (m_SetBit >= 0x1000) {
187 m_SetBit = invalidDetector;
188 return *this;
189 }
190 if ((m_DetectorSetBits & m_SetBit) != 0)
191 break;
192 }
193 m_Index++;
194 return *this;
195}

◆ operator==()

bool operator== ( const Iterator iterator)

Operator ==.

Definition at line 197 of file UnitConst.cc.

199{
200 return m_SetBit == iterator.m_SetBit;
201}

Member Data Documentation

◆ m_DetectorSetBits

uint16_t m_DetectorSetBits
private

Bits in DetectorSet.

Definition at line 162 of file Const.h.

◆ m_Index

int m_Index
private

Index.

Definition at line 159 of file Const.h.

◆ m_SetBit

uint16_t m_SetBit
private

Set bit.

Definition at line 165 of file Const.h.


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