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