Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Array< T > Class Template Reference

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

+ Inheritance diagram for 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 Collection< T >
int count (void)
 
bool contains (const T &item)
 
template<template< class _ > class C>
bool containsAll (const C< T > &collection)
 
bool isEmpty (void)
 
 operator bool (void)
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const Collection &coll)
 
bool operator== (const Collection &coll)
 
bool operator!= (const Collection &coll)
 

Additional Inherited Members

- Public Types inherited from Collection< T >
typedef T t
 
typedef Collection< T > self_t
 
- Static Public Attributes inherited from Collection< T >
static const Collection null
 
static const Collection< T > null
 

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.
Implemented by:

Member Function Documentation

◆ get()

const 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.

◆ indexOf()

int 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.

◆ lastIndexOf()

int lastIndexOf ( const T &  value,
int  start = -1 
) const

Get the index of the last occurrence 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.

◆ length()

int length ( void  )

◆ operator[]()

const T& operator[] ( int  index) const

Same as get().


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