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_ void Clear()
Definition: sample3-inl.h:83
const QueueNode< E > * Last() const
Definition: sample3-inl.h:110
void Enqueue(const E &element)
Definition: sample3-inl.h:116
const E & element() const
Definition: sample3-inl.h:54
Queue()
Definition: sample3-inl.h:77
QueueNode< E > * Head()
Definition: sample3-inl.h:105
size_t Size() const
Definition: sample3-inl.h:102
QueueNode * next()
Definition: sample3-inl.h:57
Definition: sample3-inl.h:49
const QueueNode< E > * Head() const
Definition: sample3-inl.h:106
Queue * Map(F function) const
Definition: sample3-inl.h:153
~Queue()
Definition: sample3-inl.h:80
const QueueNode * next() const
Definition: sample3-inl.h:58
E * Dequeue()
Definition: sample3-inl.h:131
Definition: sample3-inl.h:44
QueueNode< E > * Last()
Definition: sample3-inl.h:109