MCPcopy Create free account
hub / github.com/apache/arrow / Visit

Method Visit

cpp/src/arrow/dataset/forest_internal.h:90–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 /// subtree should be skipped.
89 template <typename PreVisitor, typename PostVisitor>
90 Status Visit(PreVisitor&& pre, PostVisitor&& post) const {
91 std::vector<Ref> parent_stack;
92
93 for (int i = 0; i < size_; ++i) {
94 Ref ref = {this, i};
95
96 while (parent_stack.size() > 0) {
97 if (parent_stack.back().IsAncestorOf(ref)) break;
98
99 post(parent_stack.back());
100 parent_stack.pop_back();
101 }
102
103 ARROW_ASSIGN_OR_RAISE(bool visit_subtree, pre(ref));
104
105 if (!visit_subtree) {
106 // skip descendants
107 i += ref.num_descendants();
108 continue;
109 }
110
111 parent_stack.push_back(ref);
112 }
113
114 return Status::OK();
115 }
116
117 Ref operator[](int i) const { return Ref{this, i}; }
118

Callers 10

GetAllFragmentsFunction · 0.45
GetFilteredFragmentsFunction · 0.45
ExpectForestIsFunction · 0.45
TESTFunction · 0.45
AssertScannerEqualsMethod · 0.45
TEST_PFunction · 0.45
GetFragmentsImplMethod · 0.45

Calls 6

IsAncestorOfMethod · 0.80
backMethod · 0.80
num_descendantsMethod · 0.80
push_backMethod · 0.80
OKFunction · 0.50
sizeMethod · 0.45

Tested by 7

ExpectForestIsFunction · 0.36
TESTFunction · 0.36
AssertScannerEqualsMethod · 0.36
TEST_PFunction · 0.36