The bliss C++ API
|
A simple implementation of queues with fixed maximum capacity. More...
#include <kqueue.hh>
Public Member Functions | |
KQueue () | |
void | init (const unsigned int N) |
bool | is_empty () const |
unsigned int | size () const |
void | clear () |
Type | front () const |
Type | pop_front () |
void | push_front (Type e) |
Type | pop_back () |
void | push_back (Type e) |
A simple implementation of queues with fixed maximum capacity.
bliss::KQueue< Type >::KQueue | ( | ) |
Create a new queue with capacity zero. The function init() should be called next.
void bliss::KQueue< Type >::clear | ( | ) |
Remove all the elements in the queue.
Type bliss::KQueue< Type >::front | ( | ) | const |
Return (but don't remove) the first element in the queue.
void bliss::KQueue< Type >::init | ( | const unsigned int | N | ) |
Initialize the queue to have the capacity to hold at most N elements.
bool bliss::KQueue< Type >::is_empty | ( | ) | const |
Is the queue empty?
Type bliss::KQueue< Type >::pop_back | ( | ) |
Remove and return the last element of the queue.
Type bliss::KQueue< Type >::pop_front | ( | ) |
Remove and return the first element of the queue.
void bliss::KQueue< Type >::push_back | ( | Type | e | ) |
Push the element e in the back of the queue.
void bliss::KQueue< Type >::push_front | ( | Type | e | ) |
Push the element e in the front of the queue.
unsigned int bliss::KQueue< Type >::size | ( | ) | const |
Return the number of elements in the queue.