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

#include <elm/data/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

◆ VectorQueue()

VectorQueue ( int  capacity = 4)
inline

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.

◆ ~VectorQueue()

~VectorQueue ( void  )
inline

Member Function Documentation

◆ capacity()

int capacity ( void  ) const
inline

Get the current capacity of the queue.

Returns
Current capacity.

◆ contains()

bool contains ( const T &  val) const
inline

Test if the queue contains the given value.

Parameters
valValue to look in the queue.
Returns
True if the value is found, false else.

◆ get()

const T & get ( void  )
inline

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 TreeBag< value_t, AssocComparator< K, T, Comparator< K > > >::clear().

◆ head()

const T & head ( void  ) const
inline

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.

◆ isEmpty()

bool isEmpty ( void  ) const
inline

Test if the queue is empty.

Returns
True if the queue is empty, false else.

◆ operator bool()

operator bool ( void  ) const
inline

◆ operator*()

T & operator* ( void  ) const
inline

◆ operator->()

T * operator-> ( void  ) const
inline

◆ put()

void put ( const T &  item)
inline

Put an item at the head of the queue.

Parameters
itemItem to put.

Referenced by TreeBag< value_t, AssocComparator< K, T, Comparator< K > > >::clear().

◆ reset()

void reset ( void  )
inline

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

◆ size()

int size ( void  ) const
inline

Get the current size of the queue.

Returns
Queue size.

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