Class representing an array of double values. More...
#include <DoubleArray.hpp>
Public Member Functions | |
virtual DataValue * | clone () |
Clone method. This clones the array. | |
DoubleArray (int size) | |
Constructor. This initializes the array as static, with the given size. | |
DoubleArray () | |
Default constructor. This initializes the array as dynamic. | |
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 |
String cast operation. Converts the double array into its string representation. | |
shared_ptr< Double > & | operator[] (const int index) |
Getter. Returns a pointer to the object at a specific position in the array. | |
void | pushBack (shared_ptr< Double > value) |
Operation that adds a data element at the end of the array. This operation is only valid in dynamic arrays. | |
void | pushBack (double d) |
Operation that appends a double value to the end of the array. This is only valid in dynamic arrays. | |
Protected Member Functions | |
void | copyFrom (const DataValue &otherValue) |
Protected Attributes | |
std::vector< shared_ptr< Double > > | array_ |
bool | isDynamic_ |
DataType | type_ |
Class representing an array of double values.
Definition at line 47 of file DoubleArray.hpp.
DoubleArray::DoubleArray | ( | ) |
Default constructor. This initializes the array as dynamic.
Definition at line 41 of file DoubleArray.cpp.
DoubleArray::DoubleArray | ( | int | size | ) |
Constructor. This initializes the array as static, with the given size.
size | Size of the static double array. |
Definition at line 46 of file DoubleArray.cpp.
DataValue * DoubleArray::clone | ( | ) | [virtual] |
Clone method. This clones the array.
Implements mermaid::support::data::DataValue.
Definition at line 57 of file DoubleArray.cpp.
unsigned int mermaid::support::data::DataArray< Double >::getSize | ( | ) | [inline, inherited] |
Gives the size of the array.
Definition at line 99 of file DataArray.hpp.
bool mermaid::support::data::DataArray< Double >::isDynamic | ( | ) | [inline, inherited] |
Tests if the array is dynamic or not.
Definition at line 91 of file DataArray.hpp.
DoubleArray::operator std::string | ( | ) | const [virtual] |
String cast operation. Converts the double array into its string representation.
Implements mermaid::support::data::DataValue.
Definition at line 62 of file DoubleArray.cpp.
shared_ptr<Double >& mermaid::support::data::DataArray< Double >::operator[] | ( | const int | index | ) | [inline, inherited] |
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< Double >::pushBack | ( | shared_ptr< Double > | value | ) | [inline, inherited] |
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. |
Definition at line 79 of file DataArray.hpp.
void DoubleArray::pushBack | ( | double | d | ) |
Operation that appends a double value to the end of the array. This is only valid in dynamic arrays.
d | Double value to be appended. |
Definition at line 83 of file DoubleArray.cpp.