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::genstruct::DLList< T, E > Class Template Reference

#include <elm/genstruct/DLList.h>

Classes

class  AbstractIterator
 
class  BackIterator
 
class  Iterator
 

Public Member Functions

 ~DLList (void)
 
int count (void) const
 
bool contains (const T &value) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
void clear (void)
 
void add (const T &item)
 
template<template< class _ > class C>
void addAll (const C< T > &items)
 
void remove (const T &value)
 
template<template< class _ > class C>
void removeAll (const C< T > &items)
 
void remove (const AbstractIterator &iter)
 
const T & first (void) const
 
const T & last (void) const
 
Iterator find (const T &item) const
 
Iterator find (const T &item, const Iterator &iter) const
 
void addFirst (const T &value)
 
void addLast (const T &value)
 
void removeFirst (void)
 
void removeLast (void)
 
void addAfter (const AbstractIterator &pos, const T &item)
 
void addBefore (const AbstractIterator &pos, const T &item)
 
void set (const AbstractIterator &pos, const T &item)
 
const T & head (void) const
 
get (void)
 
void put (const T &item)
 
void reset (void)
 

Detailed Description

template<class T, class E = Equiv<T>>
class elm::genstruct::DLList< T, E >

A generic implementation of a double-link list. It may be traversed using the Iterator class or BackIterator class.

Implemented Concepts
elm::concept::BiDiList elm::concept::MutableList elm::concept::Queue
Parameters
TType of items stored in the list.

Constructor & Destructor Documentation

template<class T , class E >
elm::genstruct::DLList< T, E >::~DLList ( void  )

References elm::array::clear().

Member Function Documentation

template<class T, class E = Equiv<T>>
void elm::genstruct::DLList< T, E >::add ( const T &  item)
template<class T, class E = Equiv<T>>
void elm::genstruct::DLList< T, E >::addAfter ( const AbstractIterator pos,
const T &  item 
)
template<class T , class E >
template<template< class _ > class C>
void elm::genstruct::DLList< T, E >::addAll ( const C< T > &  items)
template<class T, class E = Equiv<T>>
void elm::genstruct::DLList< T, E >::addBefore ( const AbstractIterator pos,
const T &  item 
)
template<class T , class E >
void elm::genstruct::DLList< T, E >::addFirst ( const T &  value)
template<class T , class E >
void elm::genstruct::DLList< T, E >::addLast ( const T &  value)
template<class T , class E >
void elm::genstruct::DLList< T, E >::clear ( void  )

Remove all items from the list.

Referenced by elm::genstruct::DLList< T, E >::reset().

template<class T , class E >
bool elm::genstruct::DLList< T, E >::contains ( const T &  value) const

Test if the given item is in the list. Notice that the T item type must implement the equality / inequality operators.

Parameters
Itemto look for.
Returns
True if the item is found, false else.

References elm::value().

template<class T , class E >
int elm::genstruct::DLList< T, E >::count ( void  ) const

Count the items in the list.

Returns
Item count.
template<class T, class E = Equiv<T>>
Iterator elm::genstruct::DLList< T, E >::find ( const T &  item) const
template<class T, class E = Equiv<T>>
Iterator elm::genstruct::DLList< T, E >::find ( const T &  item,
const Iterator iter 
) const
template<class T , class E >
T elm::genstruct::DLList< T, E >::first ( void  ) const

Get the first item of the list.

Returns
First item.
Warning
It is an error to call this method on an empty list.

References elm::value().

Referenced by elm::genstruct::DLList< T, E >::get(), and elm::genstruct::DLList< T, E >::head().

template<class T, class E = Equiv<T>>
T elm::genstruct::DLList< T, E >::get ( void  )
template<class T, class E = Equiv<T>>
const T& elm::genstruct::DLList< T, E >::head ( void  ) const
template<class T , class E >
bool elm::genstruct::DLList< T, E >::isEmpty ( void  ) const

Test if the list is empty.

Returns
True if the list is empty, false else.

Referenced by elm::genstruct::DLList< T, E >::operator bool().

template<class T , class E >
T elm::genstruct::DLList< T, E >::last ( void  ) const

Get the last item of the list.

Returns
Last item.
Warning
It is an error to call this method on an empty list.

References elm::value().

template<class T, class E = Equiv<T>>
elm::genstruct::DLList< T, E >::operator bool ( void  ) const
template<class T, class E = Equiv<T>>
void elm::genstruct::DLList< T, E >::put ( const T &  item)
template<class T , class E >
void elm::genstruct::DLList< T, E >::remove ( const T &  value)

References elm::value().

template<class T , class E >
void elm::genstruct::DLList< T, E >::remove ( const AbstractIterator iter)
template<class T , class E >
template<template< class _ > class C>
void elm::genstruct::DLList< T, E >::removeAll ( const C< T > &  items)
template<class T , class E >
void elm::genstruct::DLList< T, E >::removeFirst ( void  )

Remove the first item from the list.

Warning
It is an error to call this method on empty list.

Referenced by elm::genstruct::DLList< T, E >::get().

template<class T , class E >
void elm::genstruct::DLList< T, E >::removeLast ( void  )

Remove the last item from the list.

Warning
It is an error to call this method on empty list.
template<class T, class E = Equiv<T>>
void elm::genstruct::DLList< T, E >::reset ( void  )
template<class T, class E = Equiv<T>>
void elm::genstruct::DLList< T, E >::set ( const AbstractIterator pos,
const T &  item 
)

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