34 #ifndef GTEST_SAMPLES_SAMPLE3_INL_H_ 35 #define GTEST_SAMPLES_SAMPLE3_INL_H_ 54 const E&
element()
const {
return element_; }
63 explicit QueueNode(
const E& an_element) : element_(an_element), next_(NULL) {}
77 Queue() : head_(NULL), last_(NULL), size_(0) {}
91 if (node == NULL)
break;
102 size_t Size()
const {
return size_; }
120 head_ = last_ = new_node;
123 last_->next_ = new_node;
137 head_ = head_->next_;
152 template <
typename F>
155 for (
const QueueNode<E>* node = head_; node != NULL; node = node->next_) {
156 new_queue->
Enqueue(
function(node->element()));
172 #endif // GTEST_SAMPLES_SAMPLE3_INL_H_
const QueueNode * next() const
const E & element() const
void Enqueue(const E &element)
const QueueNode< E > * Last() const
const QueueNode< E > * Head() const
Queue * Map(F function) const