Home | History | Annotate | Download | only in samples

Lines Matching refs:element

42 // The element type must support copy constructor.
43 template <typename E> // E is the element type
46 // QueueNode is a node in a Queue, which consists of an element of
48 template <typename E> // E is the element type
53 // Gets the element in this node.
54 const E & element() const { return element_; }
61 // Creates a node with a given element value. The next pointer is
63 QueueNode(const E & element) : element_(element), next_(NULL) {}
73 template <typename E> // E is the element type.
105 // Gets the first element of the queue, or NULL if the queue is empty.
109 // Gets the last element of the queue, or NULL if the queue is empty.
113 // Adds an element to the end of the queue. A copy of the element is
115 // Changes made to the element in the queue doesn't affect the source
117 void Enqueue(const E & element) {
118 QueueNode<E> * new_node = new QueueNode<E>(element);
144 E * element = new E(old_head->element());
147 return element;
150 // Applies a function/functor on each element of the queue, and
157 new_queue->Enqueue(function(node->element()));