The type for variable-length multidimensional arrays. More...
#include <Array.h>
Public Member Functions | |
Array (std::size_t d, int t) | |
Multi-dimensional array constructor. More... | |
Array (const Array &rhs) | |
Copy constructor. More... | |
AbstractData * | clone () const |
It creates a new clone of the array. More... | |
te::dt::AbstractData * | getData (const std::vector< std::size_t > &i) |
Returns data from specified position. More... | |
std::size_t | getDimension () const |
Returns the numbe of dimensions of the array. More... | |
std::size_t | getDimensionSize (std::size_t i) const |
Gets the number of elements in the i-th dimension. More... | |
int | getElementsTypeCode () |
Returns the data type of the elements of the array. More... | |
int | getTypeCode () const |
Returns the type code for array data: ARRAY_TYPE. More... | |
void | insert (te::dt::AbstractData *data, const std::vector< std::size_t > &pos) |
Inserts data into specified position. More... | |
Array & | operator= (const Array &rhs) |
Assignment operator. More... | |
te::dt::AbstractData & | operator[] (const std::vector< std::size_t > &i) |
Access data in i index. More... | |
std::string | toString () const |
Return a string with all the data inside array. More... | |
~Array () | |
Destructor. More... | |
Protected Attributes | |
std::map< std::vector < std::size_t > , te::dt::AbstractData * > | m_data |
A map from positions to data. More... | |
std::size_t | m_dimension |
The number of dimensions. More... | |
std::vector< std::size_t > | m_dimensionSizes |
The vector of sizes for the dimensions. More... | |
int | m_type |
The data type of this array. More... | |
The type for variable-length multidimensional arrays.
te::dt::Array::Array | ( | std::size_t | d, |
int | t | ||
) |
Multi-dimensional array constructor.
d | The number of dimensions of the array. |
t | The data type. |
Definition at line 36 of file Array.cpp.
References m_dimension, and m_dimensionSizes.
te::dt::Array::Array | ( | const Array & | rhs | ) |
te::dt::Array::~Array | ( | ) |
|
virtual |
It creates a new clone of the array.
Implements te::dt::AbstractData.
te::dt::AbstractData * te::dt::Array::getData | ( | const std::vector< std::size_t > & | i | ) |
Returns data from specified position.
i | The position in the array to get data (d1, d2, ... dn). |
Definition at line 122 of file Array.cpp.
References te::common::GetPValue().
std::size_t te::dt::Array::getDimension | ( | ) | const |
std::size_t te::dt::Array::getDimensionSize | ( | std::size_t | i | ) | const |
int te::dt::Array::getElementsTypeCode | ( | ) |
|
inlinevirtual |
Returns the type code for array data: ARRAY_TYPE.
Implements te::dt::AbstractData.
Definition at line 144 of file Array.h.
References te::dt::ARRAY_TYPE.
void te::dt::Array::insert | ( | te::dt::AbstractData * | data, |
const std::vector< std::size_t > & | pos | ||
) |
te::dt::Array & te::dt::Array::operator= | ( | const Array & | rhs | ) |
Assignment operator.
rhs | The right-hand-side instance. |
Definition at line 59 of file Array.cpp.
References te::common::FreeContents(), m_data, m_dimension, m_dimensionSizes, and m_type.
te::dt::AbstractData & te::dt::Array::operator[] | ( | const std::vector< std::size_t > & | i | ) |
Access data in i index.
i | The data index, a vector of std::size_t. |
Definition at line 129 of file Array.cpp.
References te::common::GetPValue().
|
virtual |
Return a string with all the data inside array.
Implements te::dt::AbstractData.
Definition at line 141 of file Array.cpp.
References te::dt::AbstractData::toString().
|
protected |
A map from positions to data.
Definition at line 151 of file Array.h.
Referenced by Array(), and operator=().
|
protected |
The number of dimensions.
Definition at line 152 of file Array.h.
Referenced by Array(), and operator=().
|
protected |
The vector of sizes for the dimensions.
Definition at line 153 of file Array.h.
Referenced by Array(), and operator=().
|
protected |