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

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

+ Inheritance diagram for MutableList< T >:

Public Member Functions

T & first (void)
 
T & last (void)
 
void addFirst (const T &item)
 
void addLast (const T &item)
 
void removeFirst (void)
 
void removeLast (void)
 
void addAfter (const Iter< T > &pos, const T &item)
 
void addBefore (const Iter< T > &pos, const T &item)
 
void removeBefore (const Iter< T > &pos)
 
void removeAfter (const Iter< T > &pos)
 
void set (const Iterator< T > &pos, const T &item)
 
T & operator[] (int i)
 
- Public Member Functions inherited from List< T >
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)
 
- Public Member Functions inherited from MutableCollection< T >
MutableIter< T > begin ()
 
MutableIter< T > end ()
 
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)
 
MutableCollection< T > & operator+= (const T &item)
 
MutableCollection< T > & operator-= (const T &item)
 
void copy (const Collection< T > &items)
 
MutableCollectionoperator= (const Collection< T > &c)
 

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::MutableList< T >

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

Implemented by:
elm::BiDiList elm::List

Member Function Documentation

◆ addAfter()

void addAfter ( const Iter< T > &  pos,
const T &  item 
)

Add an item after another one.

Parameters
posPosition to add after.
itemItem to add.

◆ addBefore()

void addBefore ( const Iter< T > &  pos,
const T &  item 
)

Add an item before another one.

Parameters
posPosition to add before.
itemItem to add.

◆ addFirst()

void addFirst ( const T &  item)

Add an item as the first item before other items..

Parameters
itemItem to add.

◆ addLast()

void addLast ( const T &  item)

Add an item as the last item after other items.

Parameters
itemItem to add.

◆ first()

T& first ( void  )

Get the reference to the first item of the list.

Returns
First item reference.

◆ last()

T& last ( void  )

Get the reference to the the last item of the list.

Returns
Last item reference.

◆ operator[]()

T& operator[] ( int  i)

Get the reference on 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 reference.

◆ removeAfter()

void removeAfter ( const Iter< T > &  pos)

Remove element after the given position. It is an error to call this function with pos pointing on the last element.

◆ removeBefore()

void removeBefore ( const Iter< T > &  pos)

Remove element before the given position. It is an error to call this function with pos pointing on the first element.

Parameters
posPosition to remove before.

◆ removeFirst()

void removeFirst ( void  )

Remove the first item.

◆ removeLast()

void removeLast ( void  )

Remove the last item.

◆ set()

void set ( const Iterator< T > &  pos,
const T &  item 
)

Change an item in the list.

Parameters
posPosition of the item to change.
itemNew item to replace with.

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