Belle II Software light-2406-ragdoll
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 86 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 96 of file Const.h.

96 :
97 m_Index(index),
98 m_DetectorSetBits(detectorSetBits),
99 m_SetBit(setBit)
100 {
101 }
uint16_t m_DetectorSetBits
Bits in DetectorSet.
Definition: Const.h:171

◆ ~Iterator()

~Iterator ( )
inline

Destructor.

Definition at line 106 of file Const.h.

107 {
108 }

Member Function Documentation

◆ getDetector()

EDetector getDetector ( ) const
inline

Get detector.

Definition at line 134 of file Const.h.

135 {
136 return *(*this);
137 }

◆ getIndex()

int getIndex ( ) const
inline

Get index.

Definition at line 152 of file Const.h.

153 {
154 return m_Index;
155 }

◆ getSetBit()

uint16_t getSetBit ( ) const
inline

Get set bit.

Definition at line 160 of file Const.h.

161 {
162 return m_SetBit;
163 }

◆ increment()

void increment ( )
inline

Increment.

Definition at line 118 of file Const.h.

119 {
120 ++(*this);
121 }

◆ 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 126 of file Const.h.

127 {
129 }
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 171 of file Const.h.

◆ m_Index

int m_Index
private

Index.

Definition at line 168 of file Const.h.

◆ m_SetBit

uint16_t m_SetBit
private

Set bit.

Definition at line 174 of file Const.h.


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