>xabsl   The Extensible Agent Behavior Specification Language

XabslEngine Class Library Reference

 

xabsl::Array< T > Class Template Reference

#include <XabslArray.h>

Inheritance diagram for xabsl::Array< T >:

Inheritance graph
[legend]
Collaboration diagram for xabsl::Array< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class xabsl::Array< T >

The class implements a dynamic array.

Author:
Martin Loetzsch

Matthias JŸngel

Thomas Ršfer

Max Risler

Definition at line 82 of file XabslArray.h.


Public Member Functions

 Array ()
 Constructor.

virtual ~Array ()
 Destructor.

Array< T > & operator= (const Array< T > &other)
 Assignment operator.

 Array (const Array< T > &other)
 Copy constructor.

void clear ()
 Clears the array.

getElement (int pos) const
 Returns the value for a given array position.

void append (T element)
 The function appends a new element to the array.

void setElement (int pos, T value)
 The function sets the value of an element in the array.

int getSize () const
 The function returns the number of elements in the array.

const T & operator[] (int pos) const
 Returns the value for a given array position.

T & operator[] (int pos)
void removeLast ()
 Removes the last element of the array.

 operator Array ()

Protected Attributes

T * data
 The array.

int usedSize
 The number of elements in the array.

int allocatedSize
 The number of elements in the array.


Constructor & Destructor Documentation

template<class T>
xabsl::Array< T >::Array  )  [inline]
 

Constructor.

Definition at line 86 of file XabslArray.h.

template<class T>
virtual xabsl::Array< T >::~Array  )  [inline, virtual]
 

Destructor.

Definition at line 94 of file XabslArray.h.

template<class T>
xabsl::Array< T >::Array const Array< T > &  other  )  [inline]
 

Copy constructor.

Parameters:
other The other vector that is copied to this one

Definition at line 117 of file XabslArray.h.


Member Function Documentation

template<class T>
Array<T>& xabsl::Array< T >::operator= const Array< T > &  other  )  [inline]
 

Assignment operator.

Parameters:
other The other Array that is assigned to this one
Returns:
A reference to this object after the assignment.

Definition at line 103 of file XabslArray.h.

template<class T>
void xabsl::Array< T >::clear  )  [inline]
 

Clears the array.

Reimplemented in xabsl::NamedArray< T >, xabsl::NamedArray< Option * >, xabsl::NamedArray< Agent * >, xabsl::NamedArray< double >, xabsl::NamedArray< int >, xabsl::NamedArray< BasicBehavior * >, xabsl::NamedArray< BooleanInputSymbol * >, xabsl::NamedArray< const Enumeration * >, xabsl::NamedArray< double * >, xabsl::NamedArray< EnumeratedInputSymbol * >, xabsl::NamedArray< const EnumeratedExpression * >, xabsl::NamedArray< Statement * >, xabsl::NamedArray< DecimalInputSymbol * >, xabsl::NamedArray< EnumElement * >, xabsl::NamedArray< const DecimalExpression * >, xabsl::NamedArray< State * >, xabsl::NamedArray< bool >, xabsl::NamedArray< int * >, xabsl::NamedArray< DecimalOutputSymbol * >, xabsl::NamedArray< Enumeration * >, xabsl::NamedArray< const BooleanExpression * >, xabsl::NamedArray< BooleanOutputSymbol * >, xabsl::NamedArray< bool * >, xabsl::NamedArray< BooleanExpression * >, and xabsl::NamedArray< EnumeratedOutputSymbol * >.

Definition at line 124 of file XabslArray.h.

template<class T>
T xabsl::Array< T >::getElement int  pos  )  const [inline]
 

Returns the value for a given array position.

Note that the function crashes if the required position is bigger than the size of the array.

Reimplemented in xabsl::NamedArray< T >, xabsl::NamedArray< Option * >, xabsl::NamedArray< Agent * >, xabsl::NamedArray< double >, xabsl::NamedArray< int >, xabsl::NamedArray< BasicBehavior * >, xabsl::NamedArray< BooleanInputSymbol * >, xabsl::NamedArray< const Enumeration * >, xabsl::NamedArray< double * >, xabsl::NamedArray< EnumeratedInputSymbol * >, xabsl::NamedArray< const EnumeratedExpression * >, xabsl::NamedArray< Statement * >, xabsl::NamedArray< DecimalInputSymbol * >, xabsl::NamedArray< EnumElement * >, xabsl::NamedArray< const DecimalExpression * >, xabsl::NamedArray< State * >, xabsl::NamedArray< bool >, xabsl::NamedArray< int * >, xabsl::NamedArray< DecimalOutputSymbol * >, xabsl::NamedArray< Enumeration * >, xabsl::NamedArray< const BooleanExpression * >, xabsl::NamedArray< BooleanOutputSymbol * >, xabsl::NamedArray< bool * >, xabsl::NamedArray< BooleanExpression * >, and xabsl::NamedArray< EnumeratedOutputSymbol * >.

Definition at line 137 of file XabslArray.h.

template<class T>
void xabsl::Array< T >::append element  )  [inline]
 

The function appends a new element to the array.

Parameters:
element The new element.

Definition at line 146 of file XabslArray.h.

Referenced by xabsl::Array< BooleanExpression * >::operator[]().

template<class T>
void xabsl::Array< T >::setElement int  pos,
value
[inline]
 

The function sets the value of an element in the array.

Note that the function crashes if the element does not exist.

Parameters:
pos The position of the element in the array.
value The new element.

Definition at line 166 of file XabslArray.h.

template<class T>
int xabsl::Array< T >::getSize  )  const [inline]
 

The function returns the number of elements in the array.

Returns:
The length of the list.

Definition at line 175 of file XabslArray.h.

Referenced by xabsl::Array< BooleanExpression * >::append().

template<class T>
const T& xabsl::Array< T >::operator[] int  pos  )  const [inline]
 

Returns the value for a given array position.

Note that the function crashes if the required position is bigger than the size of the array.

Reimplemented in xabsl::NamedArray< T >, xabsl::NamedArray< Option * >, xabsl::NamedArray< Agent * >, xabsl::NamedArray< double >, xabsl::NamedArray< int >, xabsl::NamedArray< BasicBehavior * >, xabsl::NamedArray< BooleanInputSymbol * >, xabsl::NamedArray< const Enumeration * >, xabsl::NamedArray< double * >, xabsl::NamedArray< EnumeratedInputSymbol * >, xabsl::NamedArray< const EnumeratedExpression * >, xabsl::NamedArray< Statement * >, xabsl::NamedArray< DecimalInputSymbol * >, xabsl::NamedArray< EnumElement * >, xabsl::NamedArray< const DecimalExpression * >, xabsl::NamedArray< State * >, xabsl::NamedArray< bool >, xabsl::NamedArray< int * >, xabsl::NamedArray< DecimalOutputSymbol * >, xabsl::NamedArray< Enumeration * >, xabsl::NamedArray< const BooleanExpression * >, xabsl::NamedArray< BooleanOutputSymbol * >, xabsl::NamedArray< bool * >, xabsl::NamedArray< BooleanExpression * >, and xabsl::NamedArray< EnumeratedOutputSymbol * >.

Definition at line 182 of file XabslArray.h.

template<class T>
T& xabsl::Array< T >::operator[] int  pos  )  [inline]
 

Definition at line 186 of file XabslArray.h.

template<class T>
void xabsl::Array< T >::removeLast  )  [inline]
 

Removes the last element of the array.

Reimplemented in xabsl::NamedArray< T >, xabsl::NamedArray< Option * >, xabsl::NamedArray< Agent * >, xabsl::NamedArray< double >, xabsl::NamedArray< int >, xabsl::NamedArray< BasicBehavior * >, xabsl::NamedArray< BooleanInputSymbol * >, xabsl::NamedArray< const Enumeration * >, xabsl::NamedArray< double * >, xabsl::NamedArray< EnumeratedInputSymbol * >, xabsl::NamedArray< const EnumeratedExpression * >, xabsl::NamedArray< Statement * >, xabsl::NamedArray< DecimalInputSymbol * >, xabsl::NamedArray< EnumElement * >, xabsl::NamedArray< const DecimalExpression * >, xabsl::NamedArray< State * >, xabsl::NamedArray< bool >, xabsl::NamedArray< int * >, xabsl::NamedArray< DecimalOutputSymbol * >, xabsl::NamedArray< Enumeration * >, xabsl::NamedArray< const BooleanExpression * >, xabsl::NamedArray< BooleanOutputSymbol * >, xabsl::NamedArray< bool * >, xabsl::NamedArray< BooleanExpression * >, and xabsl::NamedArray< EnumeratedOutputSymbol * >.

Definition at line 193 of file XabslArray.h.

template<class T>
xabsl::Array< T >::operator Array  )  [inline]
 

Definition at line 199 of file XabslArray.h.


Member Data Documentation

template<class T>
T* xabsl::Array< T >::data [protected]
 

The array.

Definition at line 203 of file XabslArray.h.

Referenced by xabsl::Array< BooleanExpression * >::operator=().

template<class T>
int xabsl::Array< T >::usedSize [protected]
 

The number of elements in the array.

Definition at line 206 of file XabslArray.h.

Referenced by xabsl::Array< BooleanExpression * >::operator=().

template<class T>
int xabsl::Array< T >::allocatedSize [protected]
 

The number of elements in the array.

Definition at line 206 of file XabslArray.h.

Referenced by xabsl::Array< BooleanExpression * >::operator=().


The documentation for this class was generated from the following file:

Up | Main Page | Generated at Wed Aug 19 17:32:30 2009.