Class representing a data value array. More...
#include <DataArray.hpp>
Public Member Functions | |
virtual DataValue * | clone ()=0 |
string cast operator | |
DataArray (int size) | |
Constructor. This initializes the array as a static array (one whose size is fixed during time). | |
DataArray () | |
Default constructor. This initializes the array as a dynamic array (one whose size may change during time). | |
unsigned int | getSize () |
Gives the size of the array. | |
DataType | getType () |
bool | isDynamic () |
Tests if the array is dynamic or not. | |
virtual | operator std::string () const =0 |
Method to convert value to string. | |
shared_ptr< T > & | operator[] (const int index) |
Getter. Returns a pointer to the object at a specific position in the array. | |
void | pushBack (shared_ptr< T > value) |
Operation that adds a data element at the end of the array. This operation is only valid in dynamic arrays. | |
Protected Member Functions | |
void | copyFrom (const DataValue &otherValue) |
Protected Attributes | |
std::vector< shared_ptr< T > > | array_ |
bool | isDynamic_ |
DataType | type_ |
Class representing a data value array.
Definition at line 45 of file DataArray.hpp.
mermaid::support::data::DataArray< T >::DataArray | ( | ) | [inline] |
Default constructor. This initializes the array as a dynamic array (one whose size may change during time).
Definition at line 51 of file DataArray.hpp.
mermaid::support::data::DataArray< T >::DataArray | ( | int | size | ) | [inline] |
Constructor. This initializes the array as a static array (one whose size is fixed during time).
size | Size of the static array. |
Definition at line 59 of file DataArray.hpp.
virtual DataValue* mermaid::support::data::DataValue::clone | ( | ) | [pure virtual, inherited] |
string cast operator
Implements mermaid::support::syntacticsugar::Cloneable.
Implemented in mermaid::support::data::DataBox, mermaid::support::data::DataBoxArray, mermaid::support::data::Double, mermaid::support::data::DoubleArray, mermaid::support::data::Integer, mermaid::support::data::IntegerArray, mermaid::support::data::String, and mermaid::support::data::StringArray.
unsigned int mermaid::support::data::DataArray< T >::getSize | ( | ) | [inline] |
Gives the size of the array.
Definition at line 99 of file DataArray.hpp.
bool mermaid::support::data::DataArray< T >::isDynamic | ( | ) | [inline] |
Tests if the array is dynamic or not.
Definition at line 91 of file DataArray.hpp.
virtual mermaid::support::data::DataValue::operator std::string | ( | ) | const [pure virtual, inherited] |
Method to convert value to string.
Implements mermaid::support::syntacticsugar::Stringable.
Implemented in mermaid::support::data::DataBox, mermaid::support::data::DataBoxArray, mermaid::support::data::Double, mermaid::support::data::DoubleArray, mermaid::support::data::Integer, mermaid::support::data::IntegerArray, mermaid::support::data::String, and mermaid::support::data::StringArray.
shared_ptr<T>& mermaid::support::data::DataArray< T >::operator[] | ( | const int | index | ) | [inline] |
Getter. Returns a pointer to the object at a specific position in the array.
index | Position of the array to be accessed. |
Definition at line 71 of file DataArray.hpp.
void mermaid::support::data::DataArray< T >::pushBack | ( | shared_ptr< T > | value | ) | [inline] |
Operation that adds a data element at the end of the array. This operation is only valid in dynamic arrays.
value | Value to be added at the end of the array. |
Reimplemented in mermaid::support::data::DataBoxArray.
Definition at line 79 of file DataArray.hpp.