7#ifndef _MULTIARRAY_CLASS_HEADER_
8#define _MULTIARRAY_CLASS_HEADER_
228 return ERR_INVALID_STATE;
237 return ERR_INVALID_STATE;
242 return ERR_INVALID_ARG;
248 m_oData = std::vector<T>(nTotal);
277 tUInt nThisValue = 0;
283 if (nValue >= nThisValue)
308 return ERR_INVALID_INDEX;
323 return ERR_INVALID_INDEX;
332 return ERR_INVALID_INDEX;
335 nIndex += (nProduct * nK);
338 nInternIndex = nIndex;
430 return ERR_INVALID_INDEX;
433 tUInt nInternIndex = 0;
436 return ERR_INVALID_INDEX;
457 return ERR_INVALID_INDEX;
460 tUInt nInternIndex = 0;
463 return ERR_INVALID_INDEX;
unsigned int tUInt
type definition for unsigned integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
size_t tSize
type definition for a array size values, map size values etc.
#define IS_FAILED(s)
Check if result is failed.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Multi dimensional array class template.
cMultiArray(const cMultiArrayDimensions &oDimensions)
Constructor that initializes the array to the dimensions specified in the parameter.
virtual ~cMultiArray()
Virtual destructor.
tBool IsValid() const
Check if the array is in a valid state and initialized correctly.
tResult CalculateInternIndex(const cMultiArrayIndex &oIndex, tUInt &nInternIndex) const
Calculate the internal flat index that matches the multi dimensional index specified.
cMultiArrayDimensions m_oDimensions
Stores the arrays dimension object.
tResult InitializeDataStore()
Initializes the data vector to the correct size (specified by the dimensions of the array)
tSize NumElements() const
Get the total number of stored elements in the array across all dimensions.
std::vector< T > m_oData
Stores the arrays actual data (in a flat vector)
tBool ContainsIndex(const cMultiArrayIndex &oIndex) const
Check if an index is in bound of the arrays dimensions.
tResult Set(const cMultiArrayIndex &oIndex, T value)
Set the element at the specified array index.
cMultiArray()
Constructor that initializes the array to an invalid state (0 dimensions)
const cMultiArrayDimensions & Dimensions() const
Get the dimensions of the array.
tResult Get(const cMultiArrayIndex &oIndex, T &value) const
Get the element at the specified array index.
Multi dimensional index class used to dynamically address elements in a multi array.
cMultiArrayIndex()
Constructor that initializes the index to an invalid state.
tSize NumDimensions() const
Get the number of dimensions.
cMultiArrayIndex(tUInt nX, tUInt nY, tUInt nZ, tUInt nT)
Constructor that initializes the index to 4 dimension values.
cMultiArrayIndex(tUInt nX, tUInt nY, tUInt nZ)
Constructor that initializes the index to 3 dimension values.
tBool IsValid() const
Check if the index is valid.
tResult GetDimensionValue(tUInt nDimensionIndex, tUInt &nValue) const
Get the value of the specified dimension.
cMultiArrayIndex(tUInt nX, tUInt nY)
Constructor that initializes the index to 2 dimension values.
tResult AddDimension(tUInt nDimensionValue)
Add a dimension value to the index.
std::vector< tUInt > m_oDimensionvalues
Stores the dimensional values.
cMultiArrayIndex(tUInt nX)
Constructor that initializes the index to a single dimension value.
tResult SetDimensionValue(tUInt nDimensionIndex, tUInt nValue)
Set the value of the specified dimension.
cMultiArrayIndex(tUInt nX, tUInt nY, tUInt nZ, tUInt nT, tUInt nR)
Constructor that initializes the index to 4 dimension values.
ADTF A_UTIL Namespace - Within adtf this is used as util or adtf_util.
cString MultiArrayToString< tInt >(const cMultiArray< tInt > &oArray)
tInt specialization for the MultiArrayToString function
cString MultiArrayToString< tFloat32 >(const cMultiArray< tFloat32 > &oArray)
tFloat32 specialization for the MultiArrayToString function
tResult ParseMultiArrayFromString< tInt >(const cString &strRepr, cMultiArray< tInt > &arrDest)
tInt specialization for the ParseMultiArrayFromString function
tResult ParseMultiArrayFromString< tFloat64 >(const cString &strRepr, cMultiArray< tFloat64 > &arrDest)
tFloat64 specialization for the ParseMultiArrayFromString function
tResult ParseMultiArrayFromString< tFloat32 >(const cString &strRepr, cMultiArray< tFloat32 > &arrDest)
tFloat32 specialization for the ParseMultiArrayFromString function
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
tBool operator!=(const cMultiArrayIndex &o_A, const cMultiArrayIndex &o_B)
Comparison operator.
tBool operator==(const cMultiArrayIndex &o_A, const cMultiArrayIndex &o_B)
Comparison operator.
cMultiArrayIndex cMultiArrayDimensions
Type to specify array dimensions.
tResult ParseMultiArrayFromString(const cString &strRepr, cMultiArray< T > &arrDest)
Base templated function to parse a cMultiArray from a string representation.
cString MultiArrayToString(const cMultiArray< T > &oArray)
Base templated function to serialize a cMultiArray into a string.
cString MultiArrayToString< tFloat64 >(const cMultiArray< tFloat64 > &oArray)
tFloat64 specialization for the MultiArrayToString function