114 int GetAt(
int index)
const;
119 void SetAt(
int index,
int value);
194: m_bits(0), m_size(0)
208: m_bits(bits), m_size(size)
215: m_bits(index.m_bits), m_size(index.m_size)
218 Q_ASSERT((m_bits >> m_size) == 0);
264 m_bits &= quint32(1 << m_size) - 1;
275 Q_ASSERT(index >= 0);
276 Q_ASSERT(index < m_size);
278 return int(m_bits >> index) & 1;
284 Q_ASSERT(index >= 0);
285 Q_ASSERT(index < m_size);
288 m_bits |= quint32(1 << index);
291 m_bits &= ~quint32(1 << index);
305 m_bits = quint32(1 << m_size) - 1;
315 Q_ASSERT(index >= 0);
316 Q_ASSERT(index < m_size);
318 quint32 mask = quint32(1 << index);
320 bool retVal = ((m_bits & mask) == 0);
330 Q_ASSERT(index >= 0);
331 Q_ASSERT(index < m_size);
333 quint32 mask = quint32(1 << index);
335 bool retVal = ((m_bits & mask) != 0);
345 return (((boundaries.m_bits + 1) & quint32(1 << m_size)) != 0);
363 return int(m_bits + 1) >> m_size;
387 return (m_size == index.m_size) && (m_bits == index.m_bits);
393 return (m_size != index.m_size) || (m_bits != index.m_bits);
400: m_indexPtr(
NULL), m_position(0)
406: m_indexPtr(indexPtr), m_position(position)
412: m_indexPtr(iter.m_indexPtr), m_position(iter.m_position)
419 Q_ASSERT(m_indexPtr !=
NULL);
421 return m_indexPtr->GetAt(m_position);
445 return (m_indexPtr == iter.m_indexPtr) && (m_position == iter.m_position);
451 return (m_indexPtr != iter.m_indexPtr) || (m_position != iter.m_position);
457 m_indexPtr = iter.m_indexPtr;
458 m_position = iter.m_position;
static CBitManip instance
Iterator & operator=(const Iterator &iter)
bool operator==(const Iterator &iter) const
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.
Iterator End() const
Get end value of element access iterator.
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.
Iterator Begin() const
Get begin value of element access iterator.
bool Increase(const CFastBinaryIndex &boundaries)
Increase this index inside the boundaries.
void Reset()
Reset this object.
void SetAt(int index, int value)
Set element at specified index.