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::Array< T > Class Template Reference

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

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

Public Member Functions

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)
 

Detailed Description

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

This concept provides methods to access an indexed list of items.

Parameters
TType of item in the array.

Member Function Documentation

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

Get an item by its index.

Parameters
indexIndex of the item to get.
Returns
Item at the given index.
Warning
It is an error to pass an index out of bounds.
template<class T >
int elm::concept::Array< T >::indexOf ( const T &  value,
int  start = 0 
) const

Get the index of a value.

Parameters
valueValue to find the index of.
startIndex to start from.
Returns
Index of the item or -1 if not found.
template<class T >
int elm::concept::Array< T >::lastIndexOf ( const T &  value,
int  start = -1 
) const

Get the index of the last occurence of a value.

Parameters
valueValue to find the last index of.
startIndex to start from.
Returns
Index of the item or -1 if not found.
template<class T >
int elm::concept::Array< T >::length ( void  )
template<class T >
const T& elm::concept::Array< T >::operator[] ( int  index) const

Same as get().


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