forked from nodejs/llnode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-inl.h
More file actions
42 lines (33 loc) · 1.19 KB
/
node-inl.h
File metadata and controls
42 lines (33 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "node.h"
namespace llnode {
namespace node {
template <typename T, typename C>
T Queue<T, C>::Iterator::operator*() const {
return T::FromListNode(node_, current_);
}
template <typename T, typename C>
const typename Queue<T, C>::Iterator Queue<T, C>::Iterator::operator++() {
lldb::SBError sberr;
addr_t current = current_ + constants_->kNextOffset;
current = node_->process().ReadPointerFromMemory(current, sberr);
current_ = current;
return Iterator(node_, current, constants_);
}
template <typename T, typename C>
bool Queue<T, C>::Iterator::operator!=(const Iterator& that) const {
return current_ != that.current_;
}
template <typename T, typename C>
typename Queue<T, C>::Iterator Queue<T, C>::begin() const {
lldb::SBError sberr;
addr_t currentNode = raw_ + constants_->kHeadOffset;
currentNode = currentNode + constants_->kNextOffset;
currentNode = node_->process().ReadPointerFromMemory(currentNode, sberr);
return Iterator(node_, currentNode, constants_);
}
template <typename T, typename C>
typename Queue<T, C>::Iterator Queue<T, C>::end() const {
return Iterator(node_, raw_ + constants_->kHeadOffset, constants_);
}
} // namespace node
} // namespace llnode