MCPcopy Create free account
hub / github.com/apache/arrow / operator()

Method operator()

cpp/src/arrow/util/async_generator.h:1630–1644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1628 : state_(std::make_shared<State>(std::move(source), std::move(initial_value))) {}
1629
1630 Future<Enumerated<T>> operator()() {
1631 if (state_->finished) {
1632 return AsyncGeneratorEnd<Enumerated<T>>();
1633 } else {
1634 auto state = state_;
1635 return state->source().Then([state](const T& next) {
1636 auto finished = IsIterationEnd<T>(next);
1637 auto prev = Enumerated<T>{state->prev_value, state->prev_index, finished};
1638 state->prev_value = next;
1639 state->prev_index++;
1640 state->finished = finished;
1641 return prev;
1642 });
1643 }
1644 }
1645
1646 private:
1647 struct State {

Callers

nothing calls this directly

Calls 2

ThenMethod · 0.80
sourceMethod · 0.80

Tested by

no test coverage detected