33#include <NDEVR/BaseValues.h>
34#include <NDEVR/BitFlag.h>
35#include <NDEVR/BitReference.h>
46 checkBitLocationPositive();
52 return !(*m_flag)[m_bit_ref];
54 constexpr operator bool()
const
56 return (*m_flag)[m_bit_ref];
70 checkBitLocationPositive();
76 checkBitLocationNegative();
83 checkBitLocationPositive();
90 checkBitLocationNegative();
93 template<
class t_type>
97 checkBitLocationPositive();
100 template<
class t_type>
104 checkBitLocationNegative();
109 if (m_flag == other.m_flag)
110 return m_bit > other.m_bit;
112 return m_flag > other.m_flag;
116 if (m_flag == other.m_flag)
117 return m_bit < other.m_bit;
119 return m_flag < other.m_flag;
123 return std::distance(rawIterator.m_flag, this->m_flag) +
cast<ptrdiff_t>(rawIterator.m_bit - this->m_bit);
125 template<
class t_type>
130 sum.checkBitLocationPositive();
133 template<
class t_type>
138 sum.checkBitLocationNegative();
144 bool operator==(
const BitIterator& rawIterator)
const {
return (m_bit == rawIterator.m_bit && m_flag == rawIterator.m_flag); }
145 bool operator!=(
const BitIterator& rawIterator)
const {
return (m_bit != rawIterator.m_bit || m_flag != rawIterator.m_flag); }
148 void checkBitLocationPositive()
const
152 m_flag += (m_bit / 8);
157 void checkBitLocationNegative()
const
162 m_flag -= (m_bit / 8);
179 checkBitLocationPositive();
185 checkBitLocationPositive();
191 return (*m_flag)[m_bit_ref];
195 return (*m_flag)[m_bit_ref];
199 return (*m_flag)[m_bit_ref] == ref;
203 return !(*m_flag)[m_bit_ref];
205 constexpr operator bool()
const
207 return (*m_flag)[m_bit_ref];
212 checkBitLocationPositive();
218 checkBitLocationNegative();
225 checkBitLocationPositive();
232 checkBitLocationNegative();
235 template<
class t_type>
239 checkBitLocationPositive();
242 template<
class t_type>
246 checkBitLocationNegative();
252 return std::distance(rawIterator.m_flag, this->m_flag) +
cast<ptrdiff_t>(rawIterator.m_bit - this->m_bit);
261 template<
class t_type>
268 template<
class t_type>
276 void checkBitLocationPositive()
const
280 m_flag += (m_bit / 8);
285 void checkBitLocationNegative()
const
290 m_flag -= (m_bit / 8);
A bitset that stores 8 bits (elements with only two possible values: 0 or 1, true or false,...
Definition BitFlag.hpp:68
Definition BitIterator.hpp:40
BitIterator operator--(int)
Definition BitIterator.hpp:86
BitIterator(BitFlag *flag, const sint04 offset)
Definition BitIterator.hpp:42
BitIterator & operator--()
Definition BitIterator.hpp:73
bool operator!=(const BitIterator &rawIterator) const
Definition BitIterator.hpp:145
BitIterator & operator-=(const t_type &movement)
Definition BitIterator.hpp:101
bool operator<(const BitIterator &other) const
Definition BitIterator.hpp:114
bool operator!() const
Definition BitIterator.hpp:50
bool operator==(const BitIterator &rawIterator) const
Definition BitIterator.hpp:144
BitIterator operator++(int)
Definition BitIterator.hpp:79
BitReference operator*()
Definition BitIterator.hpp:58
BitIterator operator+(t_type distance) const
Definition BitIterator.hpp:126
const BitReference operator*() const
Definition BitIterator.hpp:62
BitIterator & operator=(const BitIterator &rawIterator)=default
BitIterator & operator+=(const t_type &movement)
Definition BitIterator.hpp:94
BitIterator & operator++()
Definition BitIterator.hpp:67
bool operator>(const BitIterator &other) const
Definition BitIterator.hpp:107
ptrdiff_t operator-(const BitIterator &rawIterator)
Definition BitIterator.hpp:121
BitIterator(const BitIterator &iter)=default
BitIterator operator-(t_type distance) const
Definition BitIterator.hpp:134
Definition BitReference.hpp:38
Definition BitIterator.hpp:173
bool operator*()
Definition BitIterator.hpp:189
ConstBitIterator & operator-=(const t_type &movement)
Definition BitIterator.hpp:243
bool operator*() const
Definition BitIterator.hpp:193
ConstBitIterator operator-(const t_type &movement)
Definition BitIterator.hpp:269
ConstBitIterator & operator+=(const t_type &movement)
Definition BitIterator.hpp:236
ConstBitIterator & operator=(const ConstBitIterator &rawIterator)=default
bool operator==(bool ref) const
Definition BitIterator.hpp:197
ConstBitIterator(const ConstBitIterator &iter)=default
bool operator!() const
Definition BitIterator.hpp:201
ConstBitIterator(const BitFlag *flag, uint04 offset)
Definition BitIterator.hpp:181
ConstBitIterator operator+(const t_type &movement)
Definition BitIterator.hpp:262
bool operator==(const ConstBitIterator &rawIterator) const
Definition BitIterator.hpp:258
ConstBitIterator & operator--()
Definition BitIterator.hpp:215
ConstBitIterator & operator++()
Definition BitIterator.hpp:209
ConstBitIterator(const BitFlag *flag, sint04 offset)
Definition BitIterator.hpp:175
ConstBitIterator operator--(int)
Definition BitIterator.hpp:228
bool operator!=(const ConstBitIterator &rawIterator) const
Definition BitIterator.hpp:259
ptrdiff_t operator-(const ConstBitIterator &rawIterator)
Definition BitIterator.hpp:250
ConstBitIterator operator++(int)
Definition BitIterator.hpp:221
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:76
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:250
static const t_type NaN
Definition BaseValues.hpp:274