118 int GetAt(
int index)
const;
123 void SetAt(
int index,
int value);
198: m_bits(0), m_size(0)
212: m_bits(bits), m_size(size)
219: m_bits(index.m_bits), m_size(index.m_size)
222 Q_ASSERT((m_bits >> m_size) == 0);
268 m_bits &= quint32(1 << m_size) - 1;
279 Q_ASSERT(index >= 0);
280 Q_ASSERT(index < m_size);
282 return int(m_bits >> index) & 1;
288 Q_ASSERT(index >= 0);
289 Q_ASSERT(index < m_size);
292 m_bits |= quint32(1 << index);
295 m_bits &= ~quint32(1 << index);
309 m_bits = quint32(1 << m_size) - 1;
319 Q_ASSERT(index >= 0);
320 Q_ASSERT(index < m_size);
322 quint32 mask = quint32(1 << index);
324 bool retVal = ((m_bits & mask) == 0);
334 Q_ASSERT(index >= 0);
335 Q_ASSERT(index < m_size);
337 quint32 mask = quint32(1 << index);
339 bool retVal = ((m_bits & mask) != 0);
349 return (((boundaries.m_bits + 1) & quint32(1 << m_size)) != 0);
367 return int(m_bits + 1) >> m_size;
391 return (m_size == index.m_size) && (m_bits == index.m_bits);
397 return (m_size != index.m_size) || (m_bits != index.m_bits);
404: m_indexPtr(nullptr), m_position(0)
410: m_indexPtr(indexPtr), m_position(position)
416: m_indexPtr(iter.m_indexPtr), m_position(iter.m_position)
423 Q_ASSERT(m_indexPtr !=
nullptr);
425 return m_indexPtr->GetAt(m_position);
449 return (m_indexPtr == iter.m_indexPtr) && (m_position == iter.m_position);
455 return (m_indexPtr != iter.m_indexPtr) || (m_position != iter.m_position);
461 m_indexPtr = iter.m_indexPtr;
462 m_position = iter.m_position;
static CBitManip instance
bool operator==(const iterator &iter) const
iterator & operator=(const iterator &iter)
bool operator!=(const iterator &iter) const
bool IsInside(const CFastBinaryIndex &boundaries) const
Check if index is inside boundaries.
quint32 GetBits() const
Get bit coded value of this index.
CFastBinaryIndex()
Default constructor without member initialization.
void Clear()
Set all components to 0 (false).
void SetAllTo(int value)
Set all components to specified value.
bool IncreaseAt(int index)
Increase single component at specified position.
bool IsDimensionsCountFixed() const
Check, if number dimensions is fixed.
bool operator!=(const CFastBinaryIndex &index) const
bool SetDimensionsCount(int count)
Set number of dimensions of this index.
bool Decrease(const CFastBinaryIndex &boundaries)
Decrese this index inside the boundaries.
bool operator==(const CFastBinaryIndex &index) const
int operator[](int index) const
bool IsValid() const
Check if this index is valid.
bool DecreaseAt(int index)
Decrease single component at specified position.
bool IsZero() const
Check if this index point at zero element.
int GetProductVolume() const
Get total number of elements if this index is treated as size.
int GetAt(int index) const
Get element stored at specified index.
int GetDimensionsCount() const
Get number of dimensions of this index.
bool Increase(const CFastBinaryIndex &boundaries)
Increase this index inside the boundaries.
iterator Begin() const
Get begin value of element access iterator.
void Reset()
Reset this object.
void SetAt(int index, int value)
Set element at specified index.
iterator End() const
Get end value of element access iterator.