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

#include <elm/data/ListQueue.h>

Public Member Functions

 ListQueue (void)
 
 ~ListQueue (void)
 
bool isEmpty (void) const
 
const T & head (void) const
 
get (void)
 
void put (const T &item)
 
void reset (void)
 
ListQueueoperator<< (const T &v)
 
ListQueueoperator>> (T &v)
 

Detailed Description

template<class T, class E = Equiv<T>>
class elm::ListQueue< T, E >

Simple implementation of a queue as a single link list. Notice that this class provides operator << and >> for easy use.

Parameters
TType of items stored in queue.

Implemented concepts:

Access complexity:

  • put(n) – O(n)
  • get(n) – O(n)

Memory usage:

  • two pointers for object itself,
  • one pointer + data for stored items.

Constructor & Destructor Documentation

template<class T , class E = Equiv<T>>
elm::ListQueue< T, E >::ListQueue ( void  )
template<class T , class E = Equiv<T>>
elm::ListQueue< T, E >::~ListQueue ( void  )

Member Function Documentation

template<class T , class E = Equiv<T>>
T elm::ListQueue< T, E >::get ( void  )

Get and remove the head of the queue.

Returns
Queue head.
template<class T , class E = Equiv<T>>
const T & elm::ListQueue< T, E >::head ( void  ) const

Get the head of the queue.

Returns
Queue head.
template<class T , class E = Equiv<T>>
bool elm::ListQueue< T, E >::isEmpty ( void  ) const

Test if the queue is empty.

Returns
True if empty, false else.
template<class T , class E = Equiv<T>>
ListQueue& elm::ListQueue< T, E >::operator<< ( const T &  v)
template<class T , class E = Equiv<T>>
ListQueue& elm::ListQueue< T, E >::operator>> ( T &  v)
template<class T , class E = Equiv<T>>
void elm::ListQueue< T, E >::put ( const T &  item)

Add a new item at the end of the queue.

Parameters
itemItem to add.

Referenced by elm::ListQueue< T, E >::operator<<().

template<class T , class E = Equiv<T>>
void elm::ListQueue< T, E >::reset ( void  )

Reset the queue.

Referenced by elm::ListQueue< T, E >::~ListQueue().


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