Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
istd::TArray< Element, Dimensions > Class Template Reference

Multidimensional array with fixed number of dimensions. More...

#include <TArray.h>

Classes

class  Iterator
 

Public Types

typedef TIndex< Dimensions > IndexType
 
typedef TIndex< Dimensions > SizesType
 
typedef Element ElementType
 

Public Member Functions

 TArray ()
 
 TArray (const TArray &array)
 
 TArray (const SizesType &sizes, const ElementType &value=ElementType())
 
void Reset ()
 Removes all elements and set all sizes to 0. More...
 
bool IsEmpty () const
 Check if this array has no elements. More...
 
bool IsDimensionsCountFixed () const
 Check, if number dimensions is fixed. More...
 
int GetDimensionsCount () const
 Get number of dimensions of this array. More...
 
bool SetDimensionsCount (int count)
 Set number of dimensions of this array. More...
 
const SizesTypeGetSizes () const
 Get list of all sizes. More...
 
bool SetSizes (const SizesType &sizes)
 Set list of all sizes. More...
 
int GetSize (int dimension) const
 Get size of array for specified dimension. More...
 
bool SetSize (int dimension, int size)
 Set size of array for specified dimension. More...
 
const Element & GetAt (const IndexType &index) const
 Get element stored at specified index. More...
 
Element & GetAtRef (const IndexType &index)
 Get reference to element stored at specified index. More...
 
void SetAt (const IndexType &index, const Element &value)
 Set element at specified index. More...
 
void SetAllElements (const Element &value)
 Set some value to all elements. More...
 
Iterator Begin () const
 Get begin value of element access iterator. More...
 
const IteratorEnd () const
 Get end value of element access iterator. More...
 
bool operator== (const TArray< Element, Dimensions > &value) const
 
bool operator!= (const TArray< Element, Dimensions > &value) const
 
const Element & operator[] (const IndexType &index) const
 
Element & operator[] (const IndexType &index)
 

Protected Types

typedef std::vector< Element > Elements
 

Protected Member Functions

int GetElementIndex (const IndexType &index) const
 Get index of element in one dimensional array. More...
 
void UpdateElementsSize (const ElementType &value=ElementType())
 Update size of elements to size changes. More...
 
void DeepCopy (const Elements &elements, const SizesType &sizes)
 

Protected Attributes

SizesType m_sizes
 
Elements m_elements
 

Detailed Description

template<class Element, int Dimensions>
class istd::TArray< Element, Dimensions >

Multidimensional array with fixed number of dimensions.

Definition at line 23 of file TArray.h.

Member Typedef Documentation

template<class Element, int Dimensions>
typedef std::vector<Element> istd::TArray< Element, Dimensions >::Elements
protected

Definition at line 158 of file TArray.h.

template<class Element, int Dimensions>
typedef Element istd::TArray< Element, Dimensions >::ElementType

Definition at line 28 of file TArray.h.

template<class Element, int Dimensions>
typedef TIndex<Dimensions> istd::TArray< Element, Dimensions >::IndexType

Definition at line 26 of file TArray.h.

template<class Element, int Dimensions>
typedef TIndex<Dimensions> istd::TArray< Element, Dimensions >::SizesType

Definition at line 27 of file TArray.h.

Constructor & Destructor Documentation

template<class Element , int Dimensions>
istd::TArray< Element, Dimensions >::TArray ( )

Definition at line 318 of file TArray.h.

template<class Element , int Dimensions>
istd::TArray< Element, Dimensions >::TArray ( const TArray< Element, Dimensions > &  array)

Definition at line 327 of file TArray.h.

template<class Element , int Dimensions>
istd::TArray< Element, Dimensions >::TArray ( const SizesType sizes,
const ElementType value = ElementType() 
)
explicit

Member Function Documentation

template<class Element , int Dimensions>
TArray< Element, Dimensions >::Iterator istd::TArray< Element, Dimensions >::Begin ( ) const

Get begin value of element access iterator.

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

Definition at line 265 of file TArray.h.

template<class Element , int Dimensions>
void istd::TArray< Element, Dimensions >::DeepCopy ( const Elements elements,
const SizesType sizes 
)
protected

Definition at line 417 of file TArray.h.

template<class Element , int Dimensions>
const TArray< Element, Dimensions >::Iterator & istd::TArray< Element, Dimensions >::End ( ) const

Get end value of element access iterator.

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

Definition at line 272 of file TArray.h.

template<class Element , int Dimensions>
const Element & istd::TArray< Element, Dimensions >::GetAt ( const IndexType index) const
inline

Get element stored at specified index.

Definition at line 227 of file TArray.h.

References istd::TIndex< Dimensions >::IsInside().

Referenced by imath::CSampledFunction2d::GetSampleValue().

template<class Element , int Dimensions>
Element & istd::TArray< Element, Dimensions >::GetAtRef ( const IndexType index)
inline

Get reference to element stored at specified index.

Definition at line 239 of file TArray.h.

References istd::TIndex< Dimensions >::IsInside().

template<class Element , int Dimensions>
int istd::TArray< Element, Dimensions >::GetDimensionsCount ( ) const
inline

Get number of dimensions of this array.

Definition at line 196 of file TArray.h.

template<class Element , int Dimensions>
int istd::TArray< Element, Dimensions >::GetElementIndex ( const IndexType index) const
inlineprotected

Get index of element in one dimensional array.

Definition at line 298 of file TArray.h.

template<class Element , int Dimensions>
int istd::TArray< Element, Dimensions >::GetSize ( int  dimension) const
inline

Get size of array for specified dimension.

Definition at line 217 of file TArray.h.

template<class Element , int Dimensions>
const TArray< Element, Dimensions >::SizesType & istd::TArray< Element, Dimensions >::GetSizes ( ) const
inline
template<class Element , int Dimensions>
bool istd::TArray< Element, Dimensions >::IsDimensionsCountFixed ( ) const
inline

Check, if number dimensions is fixed.

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

Definition at line 189 of file TArray.h.

template<class Element , int Dimensions>
bool istd::TArray< Element, Dimensions >::IsEmpty ( ) const

Check if this array has no elements.

Definition at line 182 of file TArray.h.

template<class Element, int Dimensions>
bool istd::TArray< Element, Dimensions >::operator!= ( const TArray< Element, Dimensions > &  value) const
template<class Element, int Dimensions>
bool istd::TArray< Element, Dimensions >::operator== ( const TArray< Element, Dimensions > &  value) const
template<class Element , int Dimensions>
const Element & istd::TArray< Element, Dimensions >::operator[] ( const IndexType index) const
inline

Definition at line 279 of file TArray.h.

template<class Element , int Dimensions>
Element & istd::TArray< Element, Dimensions >::operator[] ( const IndexType index)
inline

Definition at line 286 of file TArray.h.

template<class Element , int Dimensions>
void istd::TArray< Element, Dimensions >::Reset ( )

Removes all elements and set all sizes to 0.

Definition at line 342 of file TArray.h.

template<class Element, int Dimensions>
void istd::TArray< Element, Dimensions >::SetAllElements ( const Element &  value)

Set some value to all elements.

Definition at line 376 of file TArray.h.

template<class Element, int Dimensions>
void istd::TArray< Element, Dimensions >::SetAt ( const IndexType index,
const Element &  value 
)
inline

Set element at specified index.

Definition at line 251 of file TArray.h.

References istd::TIndex< Dimensions >::IsInside().

Referenced by imath::CSampledFunction2d::SetSampleValue().

template<class Element , int Dimensions>
bool istd::TArray< Element, Dimensions >::SetDimensionsCount ( int  count)
inline

Set number of dimensions of this array.

This is only dummy method, to provide methods compatibility with template implementations.

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 203 of file TArray.h.

template<class Element , int Dimensions>
bool istd::TArray< Element, Dimensions >::SetSize ( int  dimension,
int  size 
)

Set size of array for specified dimension.

Please note, that it can make all elements invalid.

Returns
always true, it is provided for generic implementations.

Definition at line 362 of file TArray.h.

template<class Element , int Dimensions>
bool istd::TArray< Element, Dimensions >::SetSizes ( const SizesType sizes)

Set list of all sizes.

Returns
always true, it is provided for generic implementations.

Definition at line 351 of file TArray.h.

template<class Element , int Dimensions>
void istd::TArray< Element, Dimensions >::UpdateElementsSize ( const ElementType value = ElementType())
protected

Update size of elements to size changes.

Definition at line 405 of file TArray.h.

Referenced by istd::TArray< Element, Dimensions >::TArray().

Member Data Documentation

template<class Element, int Dimensions>
Elements istd::TArray< Element, Dimensions >::m_elements
protected
template<class Element, int Dimensions>
SizesType istd::TArray< Element, Dimensions >::m_sizes
protected

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

© 2007-2017 Witold Gantzke and Kirill Lepskiy