Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Types
Saf::Collection::Queue< ValType, ContainerType > Class Template Reference

First-in first-out queue container. More...

#include <Queue.h>

List of all members.

Public Member Functions

 Queue ()
 Constructor.
 Queue (const MyType &queue)
 Copy constructor.
 Queue (const ContainerType &cont)
 Construct using the supplied container.
ValType & Back ()
 Get reference to the element at the back of the queue.
const ValType & Back () const
 Get reference to the element at the back of the queue.
const ContainerType & Container () const
 Get the internal data container reference.
Size Elements () const
 Get the number of elements in the queue.
ValType & Front ()
 Get reference to the element at the front of the queue.
const ValType & Front () const
 Get reference to the element at the front of the queue.
bool IsEmpty () const
 Check whether the queue is empty.
MyTypeoperator= (MyType &queue)
 Assignment operator.
MyTypePop ()
 Remove the element at the front of the queue.
MyTypePush (const ValType &val)
 Add new element at the back of the queue.
MyTypeSwap (MyType &queue)
 Swap the content of two queues.

Protected Types

typedef Queue< ValType,
ContainerType > 
MyType

Detailed Description

template<class ValType, class ContainerType = Deque<ValType>>
class Saf::Collection::Queue< ValType, ContainerType >

First-in first-out queue container.

This class implements a traditional queue container where elements are inserted to the back and extracted only from the front of the container.

Technically, an underlying container is used to store the data. The encapsulated container must provide the following methods:

Template Parameters:
ValTypeData type of values in the queue.
ContainerTypeUnderlying container storing the data.
See also:
Stack, PriorityQueue, Deqeue, List, ForwardList, DynArray.

Member Typedef Documentation

template<class ValType, class ContainerType = Deque<ValType>>
typedef Queue<ValType,ContainerType> Saf::Collection::Queue< ValType, ContainerType >::MyType [protected]

Constructor & Destructor Documentation

template<class ValType, class ContainerType = Deque<ValType>>
Saf::Collection::Queue< ValType, ContainerType >::Queue ( ) [inline]

Constructor.

template<class ValType, class ContainerType = Deque<ValType>>
Saf::Collection::Queue< ValType, ContainerType >::Queue ( const MyType queue) [inline]

Copy constructor.

template<class ValType, class ContainerType = Deque<ValType>>
Saf::Collection::Queue< ValType, ContainerType >::Queue ( const ContainerType &  cont) [inline, explicit]

Construct using the supplied container.


Member Function Documentation

template<class ValType, class ContainerType = Deque<ValType>>
ValType& Saf::Collection::Queue< ValType, ContainerType >::Back ( ) [inline]

Get reference to the element at the back of the queue.

template<class ValType, class ContainerType = Deque<ValType>>
const ValType& Saf::Collection::Queue< ValType, ContainerType >::Back ( ) const [inline]

Get reference to the element at the back of the queue.

template<class ValType, class ContainerType = Deque<ValType>>
const ContainerType& Saf::Collection::Queue< ValType, ContainerType >::Container ( ) const [inline]

Get the internal data container reference.

template<class ValType, class ContainerType = Deque<ValType>>
Size Saf::Collection::Queue< ValType, ContainerType >::Elements ( ) const [inline]

Get the number of elements in the queue.

template<class ValType, class ContainerType = Deque<ValType>>
ValType& Saf::Collection::Queue< ValType, ContainerType >::Front ( ) [inline]

Get reference to the element at the front of the queue.

template<class ValType, class ContainerType = Deque<ValType>>
const ValType& Saf::Collection::Queue< ValType, ContainerType >::Front ( ) const [inline]

Get reference to the element at the front of the queue.

template<class ValType, class ContainerType = Deque<ValType>>
bool Saf::Collection::Queue< ValType, ContainerType >::IsEmpty ( ) const [inline]

Check whether the queue is empty.

template<class ValType, class ContainerType = Deque<ValType>>
MyType& Saf::Collection::Queue< ValType, ContainerType >::operator= ( MyType queue) [inline]

Assignment operator.

template<class ValType, class ContainerType = Deque<ValType>>
MyType& Saf::Collection::Queue< ValType, ContainerType >::Pop ( ) [inline]

Remove the element at the front of the queue.

template<class ValType, class ContainerType = Deque<ValType>>
MyType& Saf::Collection::Queue< ValType, ContainerType >::Push ( const ValType &  val) [inline]

Add new element at the back of the queue.

template<class ValType, class ContainerType = Deque<ValType>>
MyType& Saf::Collection::Queue< ValType, ContainerType >::Swap ( MyType queue) [inline]

Swap the content of two queues.


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