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

#include <elm/genstruct/VectorQueue.h>

Public Member Functions

 VectorQueue (int capacity=4)
 
 ~VectorQueue (void)
 
int capacity (void) const
 
int size (void) const
 
bool isEmpty (void) const
 
bool contains (const T &val) const
 
void put (const T &value)
 
const T & get (void)
 
T & head (void) const
 
void reset (void)
 
 operator bool (void) const
 
T * operator-> (void) const
 
T & operator* (void) const
 

Constructor & Destructor Documentation

template<class T , class E >
elm::genstruct::VectorQueue< T, E >::VectorQueue ( int  capacity = 4)

Build a new vector queque. The passed capacity will be used for computing the actual capacity as power of two of the capacity.

Parameters
capacityCapacity exponent.
template<class T , class E >
elm::genstruct::VectorQueue< T, E >::~VectorQueue ( void  )

Member Function Documentation

template<class T , class E >
int elm::genstruct::VectorQueue< T, E >::capacity ( void  ) const

Get the current capacity of the queue.

Returns
Current capacity.
template<class T, class E = Equiv<T>>
bool elm::genstruct::VectorQueue< T, E >::contains ( const T &  val) const

Test if the queue contains the given value.

Parameters
valValue to look in the queue.
Returns
True if the value is found, false else.
template<class T , class E >
const T & elm::genstruct::VectorQueue< T, E >::get ( void  )

Get and remove the head item of the queue.

Warning
It is an error to perform this call when the queue is empty.
Returns
Head item.

Referenced by elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::clear().

template<class T , class E >
const T & elm::genstruct::VectorQueue< T, E >::head ( void  ) const

Get the head item of the queue without removing it.

Warning
It is an error to perform this call when the queue is empty.
Returns
Head item.
template<class T , class E >
bool elm::genstruct::VectorQueue< T, E >::isEmpty ( void  ) const

Test if the queue is empty.

Returns
True if the queue is empty, false else.
template<class T , class E >
elm::genstruct::VectorQueue< T, E >::operator bool ( void  ) const
template<class T , class E >
T & elm::genstruct::VectorQueue< T, E >::operator* ( void  ) const
template<class T , class E >
T * elm::genstruct::VectorQueue< T, E >::operator-> ( void  ) const
template<class T, class E >
void elm::genstruct::VectorQueue< T, E >::put ( const T &  item)

Put an item at the head of the queue.

Parameters
itemItem to put.

References elm::value().

Referenced by elm::genstruct::GenSortedBinTree< value_t, PairAdapter< elm::String, elm::option::Option * >, C >::clear().

template<class T , class E >
void elm::genstruct::VectorQueue< T, E >::reset ( void  )

Reset the queue to its initialstate (except for the capacity) and remove all enqueued items.

template<class T , class E >
int elm::genstruct::VectorQueue< T, E >::size ( void  ) const

Get the current size of the queue.

Returns
Queue size.

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