34#include <NDEVR/BaseValues.h>
35#include <NDEVR/BitFlag.h>
36#include <NDEVR/BitReference.h>
51 checkBitLocationPositive();
57 return !(*m_flag)[m_bit_ref];
59 constexpr operator bool()
const
61 return (*m_flag)[m_bit_ref];
75 checkBitLocationPositive();
81 checkBitLocationNegative();
88 checkBitLocationPositive();
95 checkBitLocationNegative();
98 template<
class t_type>
102 checkBitLocationPositive();
105 template<
class t_type>
109 checkBitLocationNegative();
114 if (m_flag == other.m_flag)
115 return m_bit > other.m_bit;
117 return m_flag > other.m_flag;
121 if (m_flag == other.m_flag)
122 return m_bit < other.m_bit;
124 return m_flag < other.m_flag;
128 return std::distance(rawIterator.m_flag, this->m_flag) +
cast<ptrdiff_t>(rawIterator.m_bit - this->m_bit);
130 template<
class t_type>
135 sum.checkBitLocationPositive();
138 template<
class t_type>
143 sum.checkBitLocationNegative();
149 bool operator==(
const BitIterator& rawIterator)
const {
return (m_bit == rawIterator.m_bit && m_flag == rawIterator.m_flag); }
150 bool operator!=(
const BitIterator& rawIterator)
const {
return (m_bit != rawIterator.m_bit || m_flag != rawIterator.m_flag); }
153 void checkBitLocationPositive()
const
157 m_flag += (m_bit / 8);
162 void checkBitLocationNegative()
const
167 m_flag -= (m_bit / 8);
187 checkBitLocationPositive();
193 checkBitLocationPositive();
199 return (*m_flag)[m_bit_ref];
203 return (*m_flag)[m_bit_ref];
207 return (*m_flag)[m_bit_ref] == ref;
211 return !(*m_flag)[m_bit_ref];
213 constexpr operator bool()
const
215 return (*m_flag)[m_bit_ref];
220 checkBitLocationPositive();
226 checkBitLocationNegative();
233 checkBitLocationPositive();
240 checkBitLocationNegative();
243 template<
class t_type>
247 checkBitLocationPositive();
250 template<
class t_type>
254 checkBitLocationNegative();
260 return std::distance(rawIterator.m_flag, this->m_flag) +
cast<ptrdiff_t>(rawIterator.m_bit - this->m_bit);
269 template<
class t_type>
276 template<
class t_type>
284 void checkBitLocationPositive()
const
288 m_flag += (m_bit / 8);
293 void checkBitLocationNegative()
const
298 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:55
Simple bit iterator, typically used for parsing Buffer of bools in loops.
Definition BitIterator.hpp:45
BitIterator operator--(int)
Definition BitIterator.hpp:91
BitIterator(BitFlag *flag, const sint04 offset)
Definition BitIterator.hpp:47
BitIterator & operator--()
Definition BitIterator.hpp:78
bool operator!=(const BitIterator &rawIterator) const
Definition BitIterator.hpp:150
BitIterator & operator-=(const t_type &movement)
Definition BitIterator.hpp:106
bool operator<(const BitIterator &other) const
Definition BitIterator.hpp:119
bool operator!() const
Definition BitIterator.hpp:55
bool operator==(const BitIterator &rawIterator) const
Definition BitIterator.hpp:149
BitIterator operator++(int)
Definition BitIterator.hpp:84
BitReference operator*()
Definition BitIterator.hpp:63
BitIterator operator+(t_type distance) const
Definition BitIterator.hpp:131
const BitReference operator*() const
Definition BitIterator.hpp:67
BitIterator & operator=(const BitIterator &rawIterator)=default
BitIterator & operator+=(const t_type &movement)
Definition BitIterator.hpp:99
BitIterator & operator++()
Definition BitIterator.hpp:72
bool operator>(const BitIterator &other) const
Definition BitIterator.hpp:112
ptrdiff_t operator-(const BitIterator &rawIterator)
Definition BitIterator.hpp:126
BitIterator(const BitIterator &iter)=default
BitIterator operator-(t_type distance) const
Definition BitIterator.hpp:139
A convenience class used with Buffers or Vectors of bools for referencing or acting on a single bit.
Definition BitReference.hpp:42
Simple bit iterator, typically used for parsing Buffer of bools in loops.
Definition BitIterator.hpp:181
bool operator*()
Definition BitIterator.hpp:197
ConstBitIterator & operator-=(const t_type &movement)
Definition BitIterator.hpp:251
bool operator*() const
Definition BitIterator.hpp:201
ConstBitIterator operator-(const t_type &movement)
Definition BitIterator.hpp:277
ConstBitIterator & operator+=(const t_type &movement)
Definition BitIterator.hpp:244
ConstBitIterator & operator=(const ConstBitIterator &rawIterator)=default
bool operator==(bool ref) const
Definition BitIterator.hpp:205
ConstBitIterator(const ConstBitIterator &iter)=default
bool operator!() const
Definition BitIterator.hpp:209
ConstBitIterator(const BitFlag *flag, uint04 offset)
Definition BitIterator.hpp:189
ConstBitIterator operator+(const t_type &movement)
Definition BitIterator.hpp:270
bool operator==(const ConstBitIterator &rawIterator) const
Definition BitIterator.hpp:266
ConstBitIterator & operator--()
Definition BitIterator.hpp:223
ConstBitIterator & operator++()
Definition BitIterator.hpp:217
ConstBitIterator(const BitFlag *flag, sint04 offset)
Definition BitIterator.hpp:183
ConstBitIterator operator--(int)
Definition BitIterator.hpp:236
bool operator!=(const ConstBitIterator &rawIterator) const
Definition BitIterator.hpp:267
ptrdiff_t operator-(const ConstBitIterator &rawIterator)
Definition BitIterator.hpp:258
ConstBitIterator operator++(int)
Definition BitIterator.hpp:229
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:171
static const t_type Invalid
Definition BaseValues.hpp:234