Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::concept::MutableArray< T > Class Template Reference

#include </home/casse/otawa/elm/src/concepts.h>

+ Inheritance diagram for elm::concept::MutableArray< T >:

Public Member Functions

void shrink (int length)
 
void set (int index, const T &item)
 
void set (const Iterator &iter, const T &item)
 
T & get (int index)
 
T & operator[] (int index)
 
void insert (int index, const T &item)
 
void insert (const Iterator &iter, const T &item)
 
void removeAt (int index)
 
void removeAt (const Iterator &iter)
 
- Public Member Functions inherited from elm::concept::Array< T >
int length (void)
 
const T & get (int index) const
 
int indexOf (const T &value, int start=0) const
 
int lastIndexOf (const T &value, int start=-1) const
 
const T & operator[] (int index) const
 
- Public Member Functions inherited from elm::concept::Collection< T >
int count (void)
 
bool contains (const T &item)
 
bool containsAll (const C< T > &collection)
 
bool isEmpty (void)
 
 operator bool (void)
 
- Public Member Functions inherited from elm::concept::MutableCollection< T >
void clear (void)
 
void add (const T &item)
 
void addAll (const Collection< T > &items)
 
void remove (const T &item)
 
void removeAll (const Collection< T > &items)
 
void remove (const Iterator< T > &iter)
 

Detailed Description

template<class T>
class elm::concept::MutableArray< T >

This concept provides mutable arrays.

Parameters
TType of the items in the array.

Member Function Documentation

template<class T >
T& elm::concept::MutableArray< T >::get ( int  index)

Get a reference on an item.

Parameters
indexIndex of the item to get a reference from.
Returns
Reference of the item.
template<class T >
void elm::concept::MutableArray< T >::insert ( int  index,
const T &  item 
)

Insert an item in the array. The following items are shifted to the upper indexes.

Parameters
indexIndex to insert to.
itemItem to insert.
template<class T >
void elm::concept::MutableArray< T >::insert ( const Iterator iter,
const T &  item 
)

Insert an item in the array. The following items are shifted to the upper indexes.

Parameters
iterIterator on the location to insert to.
itemItem to insert.
template<class T >
T& elm::concept::MutableArray< T >::operator[] ( int  index)

Fast access to the set().

template<class T >
void elm::concept::MutableArray< T >::removeAt ( int  index)

Remove the item at the given index. Following items are shift to the lower indexes.

Parameters
indexIndex of the item to remove.
template<class T >
void elm::concept::MutableArray< T >::removeAt ( const Iterator iter)

Remove the item at the given index. Following items are shift to the lower indexes.

Parameters
iterIterator on the item to remove.
template<class T >
void elm::concept::MutableArray< T >::set ( int  index,
const T &  item 
)

Set an item in the array.

Parameters
indexIndex of the item to set.
itemValue to set.
template<class T >
void elm::concept::MutableArray< T >::set ( const Iterator iter,
const T &  item 
)

Set an item in the array using an iterator.

Parameters
iterIterator on the item.
itemValue to set.
template<class T >
void elm::concept::MutableArray< T >::shrink ( int  length)

Shrink the size of the array.

Parameters
lengthNew length of the array (less than the current length).

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