32 #ifndef GTEST_SAMPLES_SAMPLE3_INL_H_ 33 #define GTEST_SAMPLES_SAMPLE3_INL_H_ 52 const E&
element()
const {
return element_; }
62 : element_(an_element), next_(
nullptr) {}
76 Queue() : head_(nullptr), last_(nullptr), size_(0) {}
90 if (node ==
nullptr)
break;
95 head_ = last_ =
nullptr;
101 size_t Size()
const {
return size_; }
119 head_ = last_ = new_node;
122 last_->next_ = new_node;
136 head_ = head_->next_;
151 template <
typename F>
155 node = node->next_) {
156 new_queue->
Enqueue(
function(node->element()));
172 #endif // GTEST_SAMPLES_SAMPLE3_INL_H_ ~Queue()
Definition: sample3-inl.h:79
Queue()
Definition: sample3-inl.h:76
Definition: sample3-inl.h:42
const QueueNode * next() const
Definition: sample3-inl.h:56
QueueNode< E > * Head()
Definition: sample3-inl.h:104
QueueNode< E > * Last()
Definition: sample3-inl.h:108
const E & element() const
Definition: sample3-inl.h:52
size_t Size() const
Definition: sample3-inl.h:101
void Clear()
Definition: sample3-inl.h:82
void Enqueue(const E &element)
Definition: sample3-inl.h:115
const QueueNode< E > * Last() const
Definition: sample3-inl.h:109
QueueNode * next()
Definition: sample3-inl.h:55
const QueueNode< E > * Head() const
Definition: sample3-inl.h:105
Queue * Map(F function) const
Definition: sample3-inl.h:152
E * Dequeue()
Definition: sample3-inl.h:130
Definition: sample3-inl.h:47