mermaid::support::data::StringArray Class Reference

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

#include <StringArray.hpp>

Inheritance diagram for mermaid::support::data::StringArray:
Inheritance graph
[legend]
Collaboration diagram for mermaid::support::data::StringArray:
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 ()
bool isDynamic ()
 Tests if the array is dynamic or not.
virtual operator std::string () const
 String cast operation. Converts the string array into its string representation.
shared_ptr< String > & operator[] (const int index)
 Getter. Returns a pointer to the object at a specific position in the array.
void pushBack (shared_ptr< String > value)
 Operation that adds a data element at the end of the array. This operation is only valid in dynamic arrays.
void pushBack (std::string s)
 Operation that appends a string value to the end of the array. This is only valid in dynamic arrays.
 StringArray (int size)
 Constructor. This initializes the array as static, with the given size.
 StringArray ()
 Default constructor. This initializes the array as dynamic.

Protected Member Functions

void copyFrom (const DataValue &otherValue)

Protected Attributes

std::vector< shared_ptr< String > > array_
bool isDynamic_
DataType type_

Detailed Description

Class representing an array of string values.

Author:
Marco Barbosa

Definition at line 47 of file StringArray.hpp.


Constructor & Destructor Documentation

StringArray::StringArray (  ) 

Default constructor. This initializes the array as dynamic.

Definition at line 40 of file StringArray.cpp.

StringArray::StringArray ( int  size  ) 

Constructor. This initializes the array as static, with the given size.

Parameters:
size Size of the static string array.

Definition at line 45 of file StringArray.cpp.


Member Function Documentation

DataValue * StringArray::clone (  )  [virtual]

Clone method. This clones the array.

Implements mermaid::support::data::DataValue.

Definition at line 55 of file StringArray.cpp.

unsigned int mermaid::support::data::DataArray< String >::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< String >::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.

StringArray::operator std::string (  )  const [virtual]

String cast operation. Converts the string array into its string representation.

Implements mermaid::support::data::DataValue.

Definition at line 60 of file StringArray.cpp.

shared_ptr<String >& mermaid::support::data::DataArray< String >::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< String >::pushBack ( shared_ptr< String 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 StringArray::pushBack ( std::string  s  ) 

Operation that appends a string value to the end of the array. This is only valid in dynamic arrays.

Parameters:
s String value to be appended.

Definition at line 81 of file StringArray.cpp.

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