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

#include <elm/data/BiDiList.h>

+ Inheritance diagram for BiDiList< T, E, A >:

Classes

class  BackIter
 
class  Iter
 

Public Member Functions

 BiDiList (void)
 
 BiDiList (const BiDiList< T > &list)
 
 ~BiDiList (void)
 
const E & equivalence () const
 
E & equivalence ()
 
const A & allocator () const
 
A & allocator ()
 
Iter reversedItems (void) const
 
int count (void) const
 
bool contains (const T &item) const
 
template<class C >
bool containsAll (const C &c) const
 
bool isEmpty (void) const
 
 operator bool (void) const
 
Iter begin (void) const
 
Iter end (void) const
 
bool equals (const BiDiList< T > &l) const
 
bool operator== (const BiDiList< T > &l) const
 
bool operator!= (const BiDiList< T > &l) const
 
void clear (void)
 
void add (const T &value)
 
template<class C >
void addAll (const C &c)
 
void remove (const T &v)
 
template<class C >
void removeAll (const C &c)
 
void remove (const Iter &i)
 
void remove (Iter &i)
 
BiDiList< T > & operator+= (const T &h)
 
BiDiList< T > & operator+= (const BiDiList< T > &l)
 
BiDiList< T > & operator-= (const T &h)
 
BiDiList< T > & operator-= (const BiDiList< T > &l)
 
void copy (const BiDiList< T > &l)
 
BiDiListoperator= (const BiDiList &list)
 
const T & first (void) const
 
const T & last (void) const
 
Iter find (const T &item) const
 
Iter find (const T &item, const Iter &pos) const
 
Iter nth (int n) const
 
const T & operator[] (int k) const
 
T & first (void)
 
T & last (void)
 
void addFirst (const T &v)
 
void addLast (const T &v)
 
void addAfter (const Iter &i, const T &value)
 
void addBefore (const Iter &i, const T &v)
 
void removeFirst ()
 
void removeLast ()
 
void removeBefore (const Iter &i)
 
void removeAfter (const Iter &i)
 
void set (const Iter &i, const T &v)
 
T & operator[] (int k)
 
const T & top () const
 
T & top ()
 
pop ()
 
void push (const T &i)
 
void reset (void)
 
const T & head () const
 
const T get (void)
 
void put (const T &v)
 
Iter operator* (void) const
 
 operator Iter (void) const
 
- Public Member Functions inherited from Equiv< T >
bool isEqual (const T &v1, const T &v2) const
 
- Public Member Functions inherited from DefaultAllocatorDelegate
t::ptr allocate (t::size size) const
 
void free (t::ptr p) const
 
template<class T >
T * alloc () const
 

Static Public Attributes

static const BiDiList< T, E, A > null
 
- Static Public Attributes inherited from Equiv< T >
static Equiv< T > def
 

Additional Inherited Members

- Public Types inherited from Equiv< T >
typedef T t
 
- Static Public Member Functions inherited from Equiv< T >
static bool equals (const T &v1, const T &v2)
 

Detailed Description

template<class T, class E = Equiv<T>, class A = DefaultAlloc>
class elm::BiDiList< T, E, A >

This class provides a generic implementation of double-link lists.

Performances
  • addition at begin / end – O(1)
  • removal – O(1)
  • find – O(n)
  • memory – 4 pointers + 2 pointers / element
Implemented concepts:
Parameters
TType of data stored in the list.
MManager supporting equivallence and allocation.

Constructor & Destructor Documentation

◆ BiDiList() [1/2]

BiDiList ( void  )
inline

◆ BiDiList() [2/2]

BiDiList ( const BiDiList< T > &  list)
inline

◆ ~BiDiList()

~BiDiList ( void  )
inline

Member Function Documentation

◆ add()

void add ( const T &  value)
inline

◆ addAfter()

void addAfter ( const Iter i,
const T &  value 
)
inline

◆ addAll()

void addAll ( const C &  c)
inline

◆ addBefore()

void addBefore ( const Iter i,
const T &  v 
)
inline

◆ addFirst()

void addFirst ( const T &  v)
inline

◆ addLast()

void addLast ( const T &  v)
inline

◆ allocator() [1/2]

A& allocator ( )
inline

◆ allocator() [2/2]

const A& allocator ( ) const
inline

◆ begin()

◆ clear()

◆ contains()

bool contains ( const T &  item) const
inline

References elm::iter().

Referenced by BiDiList< T, E, A >::containsAll().

◆ containsAll()

bool containsAll ( const C &  c) const
inline

◆ copy()

◆ count()

int count ( void  ) const
inline

References DLList::count().

◆ end()

Iter end ( void  ) const
inline

◆ equals()

bool equals ( const BiDiList< T > &  l) const
inline

◆ equivalence() [1/2]

E& equivalence ( )
inline

◆ equivalence() [2/2]

const E& equivalence ( ) const
inline

◆ find() [1/2]

Iter find ( const T &  item) const
inline

◆ find() [2/2]

Iter find ( const T &  item,
const Iter pos 
) const
inline

◆ first() [1/2]

T& first ( void  )
inline

References elm::_, and DLList::first().

◆ first() [2/2]

◆ get()

◆ head()

const T& head ( ) const
inline

◆ isEmpty()

bool isEmpty ( void  ) const
inline

◆ last() [1/2]

T& last ( void  )
inline

References elm::_, and DLList::first().

◆ last() [2/2]

const T& last ( void  ) const
inline

References elm::_, and DLList::last().

◆ nth()

Iter nth ( int  n) const
inline

◆ operator bool()

operator bool ( void  ) const
inline

◆ operator Iter()

operator Iter ( void  ) const
inline

◆ operator!=()

bool operator!= ( const BiDiList< T > &  l) const
inline

◆ operator*()

Iter operator* ( void  ) const
inline

◆ operator+=() [1/2]

BiDiList<T>& operator+= ( const BiDiList< T > &  l)
inline

◆ operator+=() [2/2]

BiDiList<T>& operator+= ( const T &  h)
inline

◆ operator-=() [1/2]

BiDiList<T>& operator-= ( const BiDiList< T > &  l)
inline

◆ operator-=() [2/2]

BiDiList<T>& operator-= ( const T &  h)
inline

◆ operator=()

BiDiList& operator= ( const BiDiList< T, E, A > &  list)
inline

◆ operator==()

bool operator== ( const BiDiList< T > &  l) const
inline

◆ operator[]() [1/2]

T& operator[] ( int  k)
inline

◆ operator[]() [2/2]

const T& operator[] ( int  k) const
inline

◆ pop()

◆ push()

void push ( const T &  i)
inline

◆ put()

void put ( const T &  v)
inline

◆ remove() [1/3]

void remove ( const Iter i)
inline

References elm::_.

◆ remove() [2/3]

◆ remove() [3/3]

void remove ( Iter i)
inline

References elm::_.

◆ removeAfter()

void removeAfter ( const Iter i)
inline

References elm::_.

◆ removeAll()

void removeAll ( const C &  c)
inline

◆ removeBefore()

void removeBefore ( const Iter i)
inline

References elm::_.

◆ removeFirst()

void removeFirst ( )
inline

◆ removeLast()

void removeLast ( )
inline

◆ reset()

void reset ( void  )
inline

◆ reversedItems()

Iter reversedItems ( void  ) const
inline

◆ set()

void set ( const Iter i,
const T &  v 
)
inline

◆ top() [1/2]

T& top ( )
inline

◆ top() [2/2]

const T& top ( ) const
inline

Member Data Documentation

◆ null

const BiDiList< T, E, A > null
static

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