2 #ifndef _MADARA_LQUEUE_H 3 #define _MADARA_LQUEUE_H 61 LQueue (
size_t size_hint = 0);
76 void enqueue (
const T &new_item);
93 size_t size (
void)
const;
109 iterator
begin (
void);
112 const_iterator
begin (
void)
const;
118 const_iterator
end (
void)
const;
150 template <
typename T>
204 template <
typename T>
Implements a forward iterator for LQueue type classes.
~LQueue(void)
Perform actions needed when queue goes out of scope.
void enqueue(const T &new_item)
Place a new_item at the tail of the queue.
iterator end(void)
Get an iterator that points to the end of the queue.
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< T > & operator=(const LQueue< T > &rhs)
Assignment operator.
LQueueConstIterator< T > const_iterator
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...
Implements a forward iterator for LQueue type classes.
iterator begin(void)
Get an iterator that points to the beginning of the queue.
LQueueIterator< T > iterator
LQueue< T > & queue_
the queue we are dealing with
auto operator*(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()*rhs.get())
void dequeue_i(void)
Remove the front item on the queue. Does not throw exceptions.
::std::forward_iterator_tag iterator_category
const LQueue< T > & queue_
the queue we are dealing with
LQueueNode< T > * tail_
We only need to keep a single pointer for the circular linked list.
void copy_list(const LQueue< T > &rhs)
bool operator==(const LQueue< T > &rhs) const
Compare this queue with rhs for equality.
::std::forward_iterator_tag iterator_category
T dequeue(void)
Remove and return the front item on the queue.
bool is_empty(void) const
Returns 1 if the queue is empty, otherwise returns 0.
Defines a node in the LQueue that's implemented as a circular linked list.
Provides utility functions and classes for common tasks and needs.
size_t size(void) const
Returns the current number of elements in the queue.
Exception thrown by methods in this class when an underflow condition occurs.
Exception thrown by methods in this class when an overflow condition occurs.
Copyright (c) 2015 Carnegie Mellon University.
Defines a generic "first-in/first-out" (FIFO) Abstract Data Type (ADT) using a circular linked list...
LQueue(size_t size_hint=0)
Constructor.
auto operator++(Tracked< T > &lhs) -> decltype(++lhs.get_mut())
size_t count_
Number of items that are currently in the queue.