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

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

+ Inheritance diagram for List< T >:

Public Member Functions

const T & first (void) const
 
const T & last (void) const
 
Iter< T > find (const T &item)
 
Iter< T > find (const T &item, const Iterator &start)
 
Iter< T > nth (int i)
 
const T & operator[] (int i) 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::List< T >

A list is an ordered sequence of items. It implements the Collection concept but the iterator traverse the list in the sequence of the items.

Implemented by:
elm::List elm::BiDiList

Member Function Documentation

◆ find() [1/2]

Iter<T> find ( const T &  item)

Find the iterator of the item equal to the given one in the list.

Parameters
itemItem to look for.
Returns
Iterator on the found item, ended item if not found.

◆ find() [2/2]

Iter<T> find ( const T &  item,
const Iterator start 
)

Find the iterator of the item equal to the given one in the list.

Parameters
itemItem to look for.
iterPosition to start from.
Returns
Iterator on the found item, ended item if not found.

◆ first()

const T& first ( void  ) const

Get the first item of the list.

Returns
First item.

◆ last()

const T& last ( void  ) const

Get the last item of the list.

Returns
Last item.

◆ nth()

Iter<T> nth ( int  i)

Get the nth item of the list. Calling this function with a i greater than the size of the list is forbidden.

Parameters
iIndex of the requested item.
Returns
Nth element.

◆ operator[]()

const T& operator[] ( int  i) const

Get the ith element. It is an error if this function is call with a i greater than list length.

Parameters
iIndex of looked element.
Returns
ith element.

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