Queue< T > Class Template Reference
A FIFO queue.
More...
List of all members.
Public Member Functions |
T * | Add (const T &value) |
| Adds the specified element to the tail end.
|
T * | Add () |
| Adds an element to the tail end of the queue, but not initializing it.
|
T * | Add (const T &value) |
| Adds the specified element to the tail end.
|
T * | Add () |
| Adds an element to the tail end of the queue, but not initializing it.
|
void | Clear () |
| Clears all elements from the queue.
|
void | Clear () |
| Clears all elements from the queue.
|
void | Init () |
| Creates an empty queue.
|
void | Init () |
| Creates an empty queue.
|
bool | is_empty () const |
| Determines if the queue is empty.
|
bool | is_empty () const |
| Determines if the queue is empty.
|
T | Pop () |
| Pops from the head of the queue, returning a copy of the item.
|
T | Pop () |
| Pops from the head of the queue, returning a copy of the item.
|
void | PopOnly () |
| Pops from the head of the queue, not returning anything.
|
void | PopOnly () |
| Pops from the head of the queue, not returning anything.
|
T & | top () |
| Gets the element at the head of the queue.
|
const T & | top () const |
| Gets the element at the head of the queue.
|
T & | top () |
| Gets the element at the head of the queue.
|
const T & | top () const |
| Gets the element at the head of the queue.
|
Detailed Description
template<typename T>
class Queue< T >
A FIFO queue.
Based on a singly linked list with a tail pointer.
TODO: A double-ended array-based queue would be faster.
Definition at line 49 of file queue.h.
Member Function Documentation
template<typename T >
T* Queue< T >::Add |
( |
const T & |
value |
) |
[inline] |
Adds the specified element to the tail end.
- Returns:
- a pointer to the tail end, which contains the given parameter
Definition at line 96 of file queue.h.
template<typename T >
T* Queue< T >::Add |
( |
|
) |
[inline] |
Adds an element to the tail end of the queue, but not initializing it.
- Returns:
- a pointer to the default-constructed but uninitialized value
Definition at line 84 of file queue.h.
template<typename T >
T* Queue< T >::Add |
( |
const T & |
value |
) |
[inline] |
Adds the specified element to the tail end.
- Returns:
- a pointer to the tail end, which contains the given parameter
Definition at line 96 of file queue.h.
template<typename T >
T* Queue< T >::Add |
( |
|
) |
[inline] |
Adds an element to the tail end of the queue, but not initializing it.
- Returns:
- a pointer to the default-constructed but uninitialized value
Definition at line 84 of file queue.h.
template<typename T >
void Queue< T >::Clear |
( |
|
) |
[inline] |
Clears all elements from the queue.
Definition at line 149 of file queue.h.
template<typename T >
void Queue< T >::Clear |
( |
|
) |
[inline] |
Clears all elements from the queue.
Definition at line 149 of file queue.h.
template<typename T >
void Queue< T >::Init |
( |
|
) |
[inline] |
Creates an empty queue.
Definition at line 74 of file queue.h.
template<typename T >
void Queue< T >::Init |
( |
|
) |
[inline] |
Creates an empty queue.
Definition at line 74 of file queue.h.
template<typename T >
bool Queue< T >::is_empty |
( |
|
) |
const [inline] |
Determines if the queue is empty.
Definition at line 128 of file queue.h.
template<typename T >
bool Queue< T >::is_empty |
( |
|
) |
const [inline] |
Determines if the queue is empty.
Definition at line 128 of file queue.h.
template<typename T >
T Queue< T >::Pop |
( |
|
) |
[inline] |
template<typename T >
T Queue< T >::Pop |
( |
|
) |
[inline] |
template<typename T >
void Queue< T >::PopOnly |
( |
|
) |
[inline] |
Pops from the head of the queue, not returning anything.
Definition at line 107 of file queue.h.
template<typename T >
void Queue< T >::PopOnly |
( |
|
) |
[inline] |
template<typename T >
T& Queue< T >::top |
( |
|
) |
[inline] |
Gets the element at the head of the queue.
Definition at line 142 of file queue.h.
template<typename T >
const T& Queue< T >::top |
( |
|
) |
const [inline] |
Gets the element at the head of the queue.
Definition at line 135 of file queue.h.
template<typename T >
T& Queue< T >::top |
( |
|
) |
[inline] |
Gets the element at the head of the queue.
Definition at line 142 of file queue.h.
template<typename T >
const T& Queue< T >::top |
( |
|
) |
const [inline] |
Gets the element at the head of the queue.
Definition at line 135 of file queue.h.
The documentation for this class was generated from the following files: