2 #ifndef _MADARA_LQUEUE_H
3 #define _MADARA_LQUEUE_H
66 LQueue(
size_t size_hint = 0);
80 void enqueue(
const T& new_item);
97 size_t size(
void)
const;
Implements a forward iterator for LQueue type classes.
::std::forward_iterator_tag iterator_category
const LQueueConstIterator< T > & operator++(void) const
Preincrement operator.
const T & operator*(void) const
Dereference operator returns a const reference to the item contained at the current position.
const LQueue< T > & queue_
the queue we are dealing with
LQueueConstIterator(const LQueue< T > &queue, size_t pos=0)
Construct an LQueueIterator at position pos.
bool operator!=(const LQueueConstIterator< T > &lhs) const
Nonequality operator.
bool operator==(const LQueueConstIterator< T > &rhs) const
Equality operator.
Implements a forward iterator for LQueue type classes.
LQueue< T > & queue_
the queue we are dealing with
LQueueIterator(LQueue< T > &queue, size_t pos=0)
Construct an LQueueIterator at position pos.
bool operator==(const LQueueIterator< T > &rhs) const
Equality operator.
bool operator!=(const LQueueIterator< T > &lhs) const
Nonequality operator.
::std::forward_iterator_tag iterator_category
T & operator*(void)
Dereference operator returns a reference to the item contained at the current position.
LQueueIterator< T > & operator++(void)
Preincrement operator.
Defines a node in the LQueue that's implemented as a circular linked list.
Exception thrown by methods in this class when an overflow condition occurs.
Exception thrown by methods in this class when an underflow condition occurs.
Defines a generic "first-in/first-out" (FIFO) Abstract Data Type (ADT) using a circular linked list.
LQueue< T > & operator=(const LQueue< T > &rhs)
Assignment operator.
T front(void) const
Returns the front queue item without removing it.
bool is_full(void) const
Returns 1 if the queue is full, otherwise returns 0.
~LQueue(void)
Perform actions needed when queue goes out of scope.
iterator begin(void)
Get an iterator that points to the beginning of the queue.
LQueueNode< T > * tail_
We only need to keep a single pointer for the circular linked list.
T dequeue(void)
Remove and return the front item on the queue.
LQueue(size_t size_hint=0)
Constructor.
LQueueConstIterator< T > const_iterator
void enqueue(const T &new_item)
Place a new_item at the tail of the queue.
bool operator==(const LQueue< T > &rhs) const
Compare this queue with rhs for equality.
size_t size(void) const
Returns the current number of elements in the queue.
bool operator!=(const LQueue< T > &s) const
Compare this queue with rhs for inequality such that *this>!=s is always the complement of the boolea...
size_t count_
Number of items that are currently in the queue.
bool is_empty(void) const
Returns 1 if the queue is empty, otherwise returns 0.
void dequeue_i(void)
Remove the front item on the queue. Does not throw exceptions.
void copy_list(const LQueue< T > &rhs)
iterator end(void)
Get an iterator that points to the end of the queue.
LQueueIterator< T > iterator
Provides utility functions and classes for common tasks and needs.
Copyright(c) 2020 Galois.