Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
ListQueue< T, M > 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)
 
bool contains (const T &val)
 
void put (const T &item)
 
void reset (void)
 
 operator bool (void) const
 
ListQueueoperator<< (const T &v)
 
ListQueueoperator>> (T &v)
 

Detailed Description

template<class T, class M = EquivManager<T>>
class elm::ListQueue< T, M >

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

◆ ListQueue()

ListQueue ( void  )
inline

◆ ~ListQueue()

~ListQueue ( void  )
inline

Member Function Documentation

◆ contains()

bool contains ( const T &  val)
inline

◆ get()

T get ( void  )
inline

Get and remove the head of the queue.

Returns
Queue head.

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

◆ head()

const T & head ( void  ) const
inline

Get the head of the queue.

Returns
Queue head.

◆ isEmpty()

bool isEmpty ( void  ) const
inline

Test if the queue is empty.

Returns
True if empty, false else.

Referenced by ListQueue< T, M >::operator bool().

◆ operator bool()

operator bool ( void  ) const
inline

◆ operator<<()

ListQueue& operator<< ( const T &  v)
inline

◆ operator>>()

ListQueue& operator>> ( T &  v)
inline

◆ put()

void put ( const T &  item)
inline

Add a new item at the end of the queue.

Parameters
itemItem to add.

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

◆ reset()

void reset ( void  )
inline

Reset the queue.

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


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