mermaid::support::data::IntegerArray Class Reference

Class representing an array of integer values. More...

#include <IntegerArray.hpp>

Inheritance diagram for mermaid::support::data::IntegerArray:
Inheritance graph
[legend]
Collaboration diagram for mermaid::support::data::IntegerArray:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Detailed Description

Class representing an array of integer values.

Author:
Marco Barbosa

Definition at line 47 of file IntegerArray.hpp.


Constructor & Destructor Documentation

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.

Parameters:
size Size of the static integer array.

Definition at line 45 of file IntegerArray.cpp.


Member Function Documentation

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.

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

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

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.

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

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

Parameters:
i Integer value to be appended.

Definition at line 82 of file IntegerArray.cpp.

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