mermaid::support::data::DataArray< T > Class Template Reference

Class representing a data value array. More...

#include <DataArray.hpp>

Inheritance diagram for mermaid::support::data::DataArray< T >:
Inheritance graph
[legend]
Collaboration diagram for mermaid::support::data::DataArray< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual DataValueclone ()=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_

Detailed Description

template<class T>
class mermaid::support::data::DataArray< T >

Class representing a data value array.

Author:
Marco Barbosa

Definition at line 45 of file DataArray.hpp.


Constructor & Destructor Documentation

template<class T>
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.

template<class T>
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).

Parameters:
size Size of the static array.

Definition at line 59 of file DataArray.hpp.


Member Function Documentation

virtual DataValue* mermaid::support::data::DataValue::clone (  )  [pure virtual, inherited]
template<class T>
unsigned int mermaid::support::data::DataArray< T >::getSize (  )  [inline]

Gives the size of the array.

Returns:
Size of the array.

Definition at line 99 of file DataArray.hpp.

template<class T>
bool mermaid::support::data::DataArray< T >::isDynamic (  )  [inline]

Tests if the array is dynamic or not.

Returns:
True if the array is dynamic, false otherwise.

Definition at line 91 of file DataArray.hpp.

virtual mermaid::support::data::DataValue::operator std::string (  )  const [pure virtual, inherited]
template<class T>
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.

Parameters:
index Position of the array to be accessed.

Definition at line 71 of file DataArray.hpp.

template<class T>
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.

Parameters:
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.

Generated on Fri Mar 4 22:15:45 2011 for MeRMaID::support by  doxygen 1.6.3