Simple Application Framework
1
|
First-in first-out queue container. More...
#include <Queue.h>
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. | |
MyType & | operator= (MyType &queue) |
Assignment operator. | |
MyType & | Pop () |
Remove the element at the front of the queue. | |
MyType & | Push (const ValType &val) |
Add new element at the back of the queue. | |
MyType & | Swap (MyType &queue) |
Swap the content of two queues. | |
Protected Types | |
typedef Queue< ValType, ContainerType > | MyType |
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:
PushBack()
PopFront()
Back()
Front()
IsEmpty()
Therefore, the following classes are examples of containers that can be used to implement the queue: Deque, List, ForwardList, DynArray.ValType | Data type of values in the queue. |
ContainerType | Underlying container storing the data. |
typedef Queue<ValType,ContainerType> Saf::Collection::Queue< ValType, ContainerType >::MyType [protected] |
Saf::Collection::Queue< ValType, ContainerType >::Queue | ( | ) | [inline] |
Constructor.
Saf::Collection::Queue< ValType, ContainerType >::Queue | ( | const MyType & | queue | ) | [inline] |
Copy constructor.
Saf::Collection::Queue< ValType, ContainerType >::Queue | ( | const ContainerType & | cont | ) | [inline, explicit] |
Construct using the supplied container.
ValType& Saf::Collection::Queue< ValType, ContainerType >::Back | ( | ) | [inline] |
Get reference to the element at the back of the queue.
const ValType& Saf::Collection::Queue< ValType, ContainerType >::Back | ( | ) | const [inline] |
Get reference to the element at the back of the queue.
const ContainerType& Saf::Collection::Queue< ValType, ContainerType >::Container | ( | ) | const [inline] |
Get the internal data container reference.
Size Saf::Collection::Queue< ValType, ContainerType >::Elements | ( | ) | const [inline] |
Get the number of elements in the queue.
ValType& Saf::Collection::Queue< ValType, ContainerType >::Front | ( | ) | [inline] |
Get reference to the element at the front of the queue.
const ValType& Saf::Collection::Queue< ValType, ContainerType >::Front | ( | ) | const [inline] |
Get reference to the element at the front of the queue.
bool Saf::Collection::Queue< ValType, ContainerType >::IsEmpty | ( | ) | const [inline] |
Check whether the queue is empty.
MyType& Saf::Collection::Queue< ValType, ContainerType >::operator= | ( | MyType & | queue | ) | [inline] |
Assignment operator.
MyType& Saf::Collection::Queue< ValType, ContainerType >::Pop | ( | ) | [inline] |
Remove the element at the front of the queue.
MyType& Saf::Collection::Queue< ValType, ContainerType >::Push | ( | const ValType & | val | ) | [inline] |
Add new element at the back of the queue.
MyType& Saf::Collection::Queue< ValType, ContainerType >::Swap | ( | MyType & | queue | ) | [inline] |
Swap the content of two queues.