Classes | Public Types | Public Member Functions | List of all members
istd::CFastBinaryIndex Class Reference

#include <CFastBinaryIndex.h>

Classes

class  Iterator
 

Public Types

enum  { MAX_ELEMENTS_COUNT = 31 }
 
typedef int IndexType
 

Public Member Functions

 CFastBinaryIndex ()
 Default constructor without member initialization. More...
 
 CFastBinaryIndex (int size, int value=0)
 Constructor initializing all member to specified value. More...
 
 CFastBinaryIndex (quint32 bits, int size, int dummy)
 Constructor initializing all internal members. More...
 
 CFastBinaryIndex (const CFastBinaryIndex &index)
 Copy constructor. More...
 
bool IsValid () const
 Check if this index is valid. More...
 
bool IsZero () const
 Check if this index point at zero element. More...
 
void Reset ()
 Reset this object. More...
 
void Clear ()
 Set all components to 0 (false). More...
 
bool IsDimensionsCountFixed () const
 Check, if number dimensions is fixed. More...
 
int GetDimensionsCount () const
 Get number of dimensions of this index. More...
 
bool SetDimensionsCount (int count)
 Set number of dimensions of this index. More...
 
int GetAt (int index) const
 Get element stored at specified index. More...
 
void SetAt (int index, int value)
 Set element at specified index. More...
 
quint32 GetBits () const
 Get bit coded value of this index. More...
 
void SetAllTo (int value)
 Set all components to specified value. More...
 
bool IncreaseAt (int index)
 Increase single component at specified position. More...
 
bool DecreaseAt (int index)
 Decrease single component at specified position. More...
 
int GetProductVolume () const
 Get total number of elements if this index is treated as size. More...
 
bool IsInside (const CFastBinaryIndex &boundaries) const
 Check if index is inside boundaries. More...
 
bool Increase (const CFastBinaryIndex &boundaries)
 Increase this index inside the boundaries. More...
 
bool Decrease (const CFastBinaryIndex &boundaries)
 Decrese this index inside the boundaries. More...
 
Iterator Begin () const
 Get begin value of element access iterator. More...
 
Iterator End () const
 Get end value of element access iterator. More...
 
int operator[] (int index) const
 
bool operator== (const CFastBinaryIndex &index) const
 
bool operator!= (const CFastBinaryIndex &index) const
 

Detailed Description

Definition at line 13 of file CFastBinaryIndex.h.

Member Typedef Documentation

Definition at line 16 of file CFastBinaryIndex.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MAX_ELEMENTS_COUNT 

Definition at line 18 of file CFastBinaryIndex.h.

Constructor & Destructor Documentation

istd::CFastBinaryIndex::CFastBinaryIndex ( )
inline

Default constructor without member initialization.

Definition at line 193 of file CFastBinaryIndex.h.

istd::CFastBinaryIndex::CFastBinaryIndex ( int  size,
int  value = 0 
)
inlineexplicit

Constructor initializing all member to specified value.

Definition at line 199 of file CFastBinaryIndex.h.

References SetAllTo().

istd::CFastBinaryIndex::CFastBinaryIndex ( quint32  bits,
int  size,
int  dummy 
)
inlineexplicit

Constructor initializing all internal members.

Parameters
bitsbit coded value of this index. The index of higher set bit must be smaller than 'size' value.
sizenumber of components of index.
dummynot used parameter using to distinguish between this constructor and the previous one.

Definition at line 207 of file CFastBinaryIndex.h.

References istd::CBitManip::instance.

istd::CFastBinaryIndex::CFastBinaryIndex ( const CFastBinaryIndex index)
inline

Copy constructor.

Definition at line 214 of file CFastBinaryIndex.h.

References MAX_ELEMENTS_COUNT.

Member Function Documentation

CFastBinaryIndex::Iterator istd::CFastBinaryIndex::Begin ( ) const
inline

Get begin value of element access iterator.

Please refer to general description of ACF iterators, STL iterators or Qt iterators concept.

Definition at line 367 of file CFastBinaryIndex.h.

void istd::CFastBinaryIndex::Clear ( )
inline

Set all components to 0 (false).

Definition at line 241 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::Decrease ( const CFastBinaryIndex boundaries)
inline

Decrese this index inside the boundaries.

Returns
in this implementation always false.

Definition at line 355 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::DecreaseAt ( int  index)
inline

Decrease single component at specified position.

Parameters
indexindex of component should be increased. It must be valid.
Returns
true if bit at index was enabled and it was possible to realize increasing.

Definition at line 328 of file CFastBinaryIndex.h.

CFastBinaryIndex::Iterator istd::CFastBinaryIndex::End ( ) const
inline

Get end value of element access iterator.

Please refer to general description of ACF iterators, STL iterators or Qt iterators concept.

Definition at line 373 of file CFastBinaryIndex.h.

int istd::CFastBinaryIndex::GetAt ( int  index) const
inline

Get element stored at specified index.

Definition at line 273 of file CFastBinaryIndex.h.

Referenced by operator[]().

quint32 istd::CFastBinaryIndex::GetBits ( ) const
inline

Get bit coded value of this index.

Definition at line 296 of file CFastBinaryIndex.h.

int istd::CFastBinaryIndex::GetDimensionsCount ( ) const
inline

Get number of dimensions of this index.

Definition at line 254 of file CFastBinaryIndex.h.

int istd::CFastBinaryIndex::GetProductVolume ( ) const
inline

Get total number of elements if this index is treated as size.

Returns
multiplication of all elements.

Definition at line 361 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::Increase ( const CFastBinaryIndex boundaries)
inline

Increase this index inside the boundaries.

Returns
in this implementation always false.

Definition at line 349 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::IncreaseAt ( int  index)
inline

Increase single component at specified position.

Parameters
indexindex of component should be increased. It must be valid.
Returns
true if bit at index was disabled and it was possible to realize increasing.

Definition at line 313 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::IsDimensionsCountFixed ( ) const
inline

Check, if number dimensions is fixed.

It is provided for template implementations. It returns always true.

Definition at line 248 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::IsInside ( const CFastBinaryIndex boundaries) const
inline

Check if index is inside boundaries.

Index is inside boundaries, if all its components are smaller than according boundary components.

Definition at line 343 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::IsValid ( ) const
inline

Check if this index is valid.

Index is valid, if all its components are bigger or equal 0. This method is provided for template compatibility with other imlementations. It returns always true.

Definition at line 222 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::IsZero ( ) const
inline

Check if this index point at zero element.

In other words, it checks if all components are 0.

Definition at line 228 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::operator!= ( const CFastBinaryIndex index) const
inline

Definition at line 391 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::operator== ( const CFastBinaryIndex index) const
inline

Definition at line 385 of file CFastBinaryIndex.h.

int istd::CFastBinaryIndex::operator[] ( int  index) const
inline

Definition at line 379 of file CFastBinaryIndex.h.

References GetAt().

void istd::CFastBinaryIndex::Reset ( )
inline

Reset this object.

For this implementation, it does the same as clear.

See Also
Clear()

Definition at line 234 of file CFastBinaryIndex.h.

void istd::CFastBinaryIndex::SetAllTo ( int  value)
inline

Set all components to specified value.

Definition at line 302 of file CFastBinaryIndex.h.

Referenced by CFastBinaryIndex().

void istd::CFastBinaryIndex::SetAt ( int  index,
int  value 
)
inline

Set element at specified index.

Definition at line 282 of file CFastBinaryIndex.h.

bool istd::CFastBinaryIndex::SetDimensionsCount ( int  count)
inline

Set number of dimensions of this index.

It is provided to allows template implementations to use fixed-size or variable arrays.

Parameters
countnumber of dimensions will be set.
Returns
true, if number of set dimensions equals template parameter or false if isn't.

Definition at line 260 of file CFastBinaryIndex.h.

References MAX_ELEMENTS_COUNT.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy