Lines Matching full:queue
38 // Queue is a simple queue implemented as a singled-linked list.
42 class Queue; variable
44 // QueueNode is a node in a Queue, which consists of an element of
48 friend class Queue<E>; variable
54 // Gets the next node in the queue.
73 class Queue {
75 // Creates an empty queue.
76 Queue() : head_(nullptr), last_(nullptr), size_(0) {} in Queue() function
78 // D'tor. Clears the queue.
79 ~Queue() { Clear(); } in ~Queue()
81 // Clears the queue.
103 // Gets the first element of the queue, or NULL if the queue is empty.
107 // Gets the last element of the queue, or NULL if the queue is empty.
111 // Adds an element to the end of the queue. A copy of the element is
112 // created using the copy constructor, and then stored in the queue.
113 // Changes made to the element in the queue doesn't affect the source
128 // Removes the head of the queue and returns it. Returns NULL if
129 // the queue is empty.
148 // Applies a function/functor on each element of the queue, and
149 // returns the result in a new queue. The original queue is not
152 Queue* Map(F function) const { in Map()
153 Queue* new_queue = new Queue(); in Map()
163 QueueNode<E>* head_; // The first node of the queue.
164 QueueNode<E>* last_; // The last node of the queue.
165 size_t size_; // The number of elements in the queue.
167 // We disallow copying a queue.
168 Queue(const Queue&);
169 const Queue& operator = (const Queue&);