MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ reduce_subtree()

template<FieldArray Array>
template<typename Acc, typename Fn>
Acc MayaFlux::Kakshya::DataForestTraversal< Array >::reduce_subtree ( size_t row,
Acc init,
Fn && fn ) const
inlinenodiscard

Fold row and its descendants into an accumulator.

Template Parameters
FnCallable returning the next accumulator from the accumulator, a row index and a borrowed element.
Returns
Final accumulator.

Definition at line 177 of file DataForestTraversal.hpp.

178 {
179 if (const auto element = m_array->at(row))
181 for_each_descendant(row, [&](size_t next, const Element& value) {
183 });
184 return init;
185 }
auto element(size_t row) const
Borrow one element by row.
bool for_each_descendant(size_t row, Fn &&fn) const
Visit every descendant of row in document order, excluding row.
std::remove_cvref_t< decltype(*std::declval< const Array & >().at(size_t {}))> Element
On-demand walks over the parent links of an indexed array.

References element(), for_each_descendant(), and m_array.

Here is the call graph for this function: