|
ACF $AcfVersion:0$
|
Multidimensional index used to addressing index. More...
#include <CVarIndex.h>
Public Types | |
| typedef int | IndexType |
| typedef QVector< int > | Elements |
| typedef Elements::iterator | Iterator |
Public Member Functions | |
| CVarIndex () | |
| Default constructor without member initialization. | |
| CVarIndex (int size, int value=0) | |
| Constructor initializing all member to specified value. | |
| CVarIndex (const CVarIndex &index) | |
| Copy constructor. | |
| CVarIndex (const std::vector< IndexType > &values) | |
| Construct index from std::vector. | |
| CVarIndex (const Elements &values) | |
| Construct index from QVector. | |
| template<int Dimensions> | |
| CVarIndex (const TIndex< Dimensions > index) | |
| Convert fixed-size index to this object. | |
| std::vector< int > | ToStdVector () const |
| bool | IsValid () const |
| Check if tihs index is valid. | |
| bool | IsZero () const |
| Check if this index point at zero element. | |
| bool | IsSizeEmpty () const |
| Check if this index interpreted as size is empty. | |
| void | Reset () |
| Reset this object. | |
| void | Clear () |
| Set all components to 0. | |
| bool | IsDimensionsCountFixed () const |
| Check, if number dimensions is fixed. | |
| int | GetDimensionsCount () const |
| Get number of dimensions of this index. | |
| bool | SetDimensionsCount (int count, int value=0) |
| Set number of dimensions of this index. | |
| int | GetAt (int index) const |
| Get element stored at specified index. | |
| void | SetAt (int index, int value) |
| Set element at specified index. | |
| void | SetAllTo (int value) |
| Set all components to specified value. | |
| bool | IncreaseAt (int index) |
| Increase single component at specified position. | |
| bool | DecreaseAt (int index) |
| Decrease single component at specified position. | |
| bool | IsInside (const CVarIndex &boundaries) const |
| Check if index is inside boundaries. | |
| bool | Increase (const CVarIndex &boundaries) |
| Increase this index inside the boundaries. | |
| bool | Decrease (const CVarIndex &boundaries) |
| Decrese this index inside the boundaries. | |
| int | GetProductVolume () const |
| Get total number of elements if this index is treated as size. | |
| int | GetIterationIndex (const CVarIndex &boundaries) const |
| Get index of iteration from zero to current index inside some boundaries. | |
| int | GetMinDimensionsCount () const |
| Get minimal number of dimensions needed to to represent this index. | |
| istd::CVarIndex | GetExpanded (const istd::CVarIndex &other) const |
| Get the index expanded by another index. | |
| Iterator | Begin () const |
| Get begin value of element access iterator. | |
| Iterator | End () const |
| Get end value of element access iterator. | |
| int | operator[] (int index) const |
| Get access to single index components. | |
| int & | operator[] (int index) |
| Get access to single index components. | |
| bool | operator== (const CVarIndex &index) const |
| bool | operator!= (const CVarIndex &index) const |
| bool | operator< (const CVarIndex &index) const |
| bool | operator> (const CVarIndex &index) const |
| bool | operator<= (const CVarIndex &index) const |
| bool | operator>= (const CVarIndex &index) const |
| CVarIndex & | operator= (const CVarIndex &index) |
| CVarIndex & | operator+= (const CVarIndex &index) |
| CVarIndex & | operator-= (const CVarIndex &index) |
Friends | |
| uint | qHash (const CVarIndex &index, uint seed) |
Multidimensional index used to addressing index.
Definition at line 22 of file CVarIndex.h.
| typedef QVector<int> istd::CVarIndex::Elements |
Definition at line 26 of file CVarIndex.h.
| typedef int istd::CVarIndex::IndexType |
Definition at line 25 of file CVarIndex.h.
| typedef Elements::iterator istd::CVarIndex::Iterator |
Definition at line 27 of file CVarIndex.h.
| istd::CVarIndex::CVarIndex | ( | ) |
Default constructor without member initialization.
|
explicit |
Constructor initializing all member to specified value.
| istd::CVarIndex::CVarIndex | ( | const CVarIndex & | index | ) |
Copy constructor.
| istd::CVarIndex::CVarIndex | ( | const std::vector< IndexType > & | values | ) |
Construct index from std::vector.
| istd::CVarIndex::CVarIndex | ( | const Elements & | values | ) |
Construct index from QVector.
| istd::CVarIndex::CVarIndex | ( | const TIndex< Dimensions > | index | ) |
Convert fixed-size index to this object.
Definition at line 429 of file CVarIndex.h.
|
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 330 of file CVarIndex.h.
| void istd::CVarIndex::Clear | ( | ) |
Set all components to 0.
| bool istd::CVarIndex::Decrease | ( | const CVarIndex & | boundaries | ) |
Decrese this index inside the boundaries.
Please note, that the number of dimensions for this index will not be changed and this operation can be unclear when number of dimensions differs from boundaries number of dimensions.
|
inline |
Decrease single component at specified position.
| index | index of component should be increased. It must be valid. |
Definition at line 281 of file CVarIndex.h.
|
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 336 of file CVarIndex.h.
|
inline |
Get element stored at specified index.
Definition at line 252 of file CVarIndex.h.
Referenced by GetMinDimensionsCount(), GetProductVolume(), and operator[]().
|
inline |
Get number of dimensions of this index.
Definition at line 232 of file CVarIndex.h.
Referenced by istd::TVarArray< Element >::GetDimensionsCount(), istd::TVarArray< Element >::GetElementIndex(), GetMinDimensionsCount(), and GetProductVolume().
|
inline |
Get the index expanded by another index.
Definition at line 320 of file CVarIndex.h.
| int istd::CVarIndex::GetIterationIndex | ( | const CVarIndex & | boundaries | ) | const |
Get index of iteration from zero to current index inside some boundaries.
|
inline |
Get minimal number of dimensions needed to to represent this index.
In other words this is index of last non-zero component + 1.
Definition at line 306 of file CVarIndex.h.
References GetAt(), and GetDimensionsCount().
|
inline |
Get total number of elements if this index is treated as size.
Definition at line 292 of file CVarIndex.h.
References GetAt(), and GetDimensionsCount().
| bool istd::CVarIndex::Increase | ( | const CVarIndex & | boundaries | ) |
Increase this index inside the boundaries.
Please note, that the number of dimensions for this index will not be changed and this operation can be unclear when number of dimensions differs from boundaries number of dimensions.
|
inline |
Increase single component at specified position.
| index | index of component should be increased. It must be valid. |
Definition at line 270 of file CVarIndex.h.
|
inline |
Check, if number dimensions is fixed.
It is provided for template implementations. It returns always false.
Definition at line 226 of file CVarIndex.h.
| bool istd::CVarIndex::IsInside | ( | const CVarIndex & | boundaries | ) | const |
Check if index is inside boundaries.
Index is inside boundaries, if all its components are smaller than according boundary components.
Referenced by istd::TVarArray< Element >::GetAt(), istd::TVarArray< Element >::Iterator::Iterator(), and istd::TVarArray< Element >::SetAt().
| bool istd::CVarIndex::IsSizeEmpty | ( | ) | const |
Check if this index interpreted as size is empty.
It means, it returns true, is some of components is less or equal 0.
| bool istd::CVarIndex::IsValid | ( | ) | const |
Check if tihs index is valid.
Index is valid if it has elements and all elements are not negative.
| bool istd::CVarIndex::IsZero | ( | ) | const |
Check if this index point at zero element.
In other words, it checks if all components are 0.
| bool istd::CVarIndex::operator!= | ( | const CVarIndex & | index | ) | const |
|
inline |
Definition at line 358 of file CVarIndex.h.
|
inline |
Definition at line 392 of file CVarIndex.h.
| bool istd::CVarIndex::operator== | ( | const CVarIndex & | index | ) | const |
|
inline |
Definition at line 375 of file CVarIndex.h.
|
inline |
Definition at line 409 of file CVarIndex.h.
|
inline |
Get access to single index components.
Definition at line 348 of file CVarIndex.h.
|
inline |
Get access to single index components.
Definition at line 342 of file CVarIndex.h.
References GetAt().
| void istd::CVarIndex::Reset | ( | ) |
Reset this object.
For this (variable size) implementation, it set dimension size to 0.
| void istd::CVarIndex::SetAllTo | ( | int | value | ) |
Set all components to specified value.
|
inline |
Set element at specified index.
Definition at line 261 of file CVarIndex.h.
|
inline |
Set number of dimensions of this index.
It is provided to allows template implementations to use fixed-size or variable arrays.
| count | number of dimensions will be set. |
Definition at line 238 of file CVarIndex.h.
|
inline |
Definition at line 60 of file CVarIndex.h.
|
friend |