ADTF
cMultiArrayIndex

Multi dimensional index class used to dynamically address elements in a multi array. More...

Public Member Functions

 cMultiArrayIndex ()
 Constructor that initializes the index to an invalid state.
 
 cMultiArrayIndex (tUInt nX)
 Constructor that initializes the index to a single dimension value. More...
 
 cMultiArrayIndex (tUInt nX, tUInt nY)
 Constructor that initializes the index to 2 dimension values. More...
 
 cMultiArrayIndex (tUInt nX, tUInt nY, tUInt nZ)
 Constructor that initializes the index to 3 dimension values. More...
 
 cMultiArrayIndex (tUInt nX, tUInt nY, tUInt nZ, tUInt nT)
 Constructor that initializes the index to 4 dimension values. More...
 
 cMultiArrayIndex (tUInt nX, tUInt nY, tUInt nZ, tUInt nT, tUInt nR)
 Constructor that initializes the index to 4 dimension values. More...
 
tBool IsValid () const
 Check if the index is valid. More...
 
tResult AddDimension (tUInt nDimensionValue)
 Add a dimension value to the index. More...
 
tResult GetDimensionValue (tUInt nDimensionIndex, tUInt &nValue) const
 Get the value of the specified dimension. More...
 
tResult SetDimensionValue (tUInt nDimensionIndex, tUInt nValue)
 Set the value of the specified dimension. More...
 
tSize NumDimensions () const
 Get the number of dimensions. More...
 

Protected Attributes

std::vector< tUIntm_oDimensionvalues
 Stores the dimensional values.
 

Detailed Description

Multi dimensional index class used to dynamically address elements in a multi array.

It is also used (see typedef to cMultiArrayDimensions) to represent the dimensions

It basically just dynamically stores a number of values for the dimensions

Definition at line 22 of file multiarray.h.

Constructor & Destructor Documentation

◆ cMultiArrayIndex() [1/5]

cMultiArrayIndex ( tUInt  nX)
explicit

Constructor that initializes the index to a single dimension value.

Parameters
nX[in] The first dimension value

◆ cMultiArrayIndex() [2/5]

cMultiArrayIndex ( tUInt  nX,
tUInt  nY 
)

Constructor that initializes the index to 2 dimension values.

Parameters
nX[in] The first dimension value
nY[in] The second dimension value

◆ cMultiArrayIndex() [3/5]

cMultiArrayIndex ( tUInt  nX,
tUInt  nY,
tUInt  nZ 
)

Constructor that initializes the index to 3 dimension values.

Parameters
nX[in] The first dimension value
nY[in] The second dimension value
nZ[in] The third dimension value

◆ cMultiArrayIndex() [4/5]

cMultiArrayIndex ( tUInt  nX,
tUInt  nY,
tUInt  nZ,
tUInt  nT 
)

Constructor that initializes the index to 4 dimension values.

Parameters
nX[in] The first dimension value
nY[in] The second dimension value
nZ[in] The third dimension value
nT[in] The fourth dimension value

◆ cMultiArrayIndex() [5/5]

cMultiArrayIndex ( tUInt  nX,
tUInt  nY,
tUInt  nZ,
tUInt  nT,
tUInt  nR 
)

Constructor that initializes the index to 4 dimension values.

Parameters
nX[in] The first dimension value
nY[in] The second dimension value
nZ[in] The third dimension value
nT[in] The fourth dimension value
nR[in] The fifth dimension value

Member Function Documentation

◆ AddDimension()

tResult AddDimension ( tUInt  nDimensionValue)

Add a dimension value to the index.

Parameters
nDimensionValue[in] The new dimension value
Returns
Returns standard result

◆ GetDimensionValue()

tResult GetDimensionValue ( tUInt  nDimensionIndex,
tUInt nValue 
) const

Get the value of the specified dimension.

Parameters
nDimensionIndex[in] The index of the dimension
nValue[out] Destination parameter for the value
Returns
Returns standard result (if ERR_NO_ERROR nValue is set)

Referenced by cMultiArray< T >::CalculateInternIndex(), cMultiArray< T >::ContainsIndex(), and cMultiArray< T >::InitializeDataStore().

◆ IsValid()

tBool IsValid ( ) const

Check if the index is valid.

Returns
Returns true if the index is valid, false otherwise

Referenced by cMultiArray< T >::CalculateInternIndex(), cMultiArray< T >::ContainsIndex(), cMultiArray< T >::Get(), cMultiArray< T >::IsValid(), and cMultiArray< T >::Set().

◆ NumDimensions()

tSize NumDimensions ( ) const

Get the number of dimensions.

Returns
Returns the number if dimensions in the index

Referenced by cMultiArray< T >::CalculateInternIndex(), cMultiArray< T >::ContainsIndex(), and cMultiArray< T >::InitializeDataStore().

◆ SetDimensionValue()

tResult SetDimensionValue ( tUInt  nDimensionIndex,
tUInt  nValue 
)

Set the value of the specified dimension.

Parameters
nDimensionIndex[in] The index of the dimension
nValue[in] New value of the dimension
Returns
Returns standard result