20 std::string& error, uint64_t* error_row =
nullptr);
51 std::string_view parent_field,
size_t row, std::string& error);
76 [[nodiscard]]
static std::shared_ptr<const CompositeForest>
build(
78 std::string& error, uint64_t* error_row =
nullptr);
100 size_t row, std::string& error)
const
Owns a sequence of values that share a CompositeLayout.
std::optional< Region > subtree_region(size_t row) const
Region covering the subtree of row, or nullopt as forest_subtree_region.
CompositeForest(CompositeArray rows, ForestIndex index, std::string parent_field)
DataForestTraversal< CompositeArray > traversal() const noexcept
A traversal borrowing the owned rows and index.
const ForestIndex & index() const noexcept
The index of the owned rows.
std::optional< CompositeArray > copy_subtree(size_t row, std::string &error) const
Self-contained copy of the subtree of row, as copy_forest_subtree.
const CompositeArray & rows() const noexcept
The owned rows.
static std::shared_ptr< const CompositeForest > build(CompositeArray rows, std::string_view parent_field, std::string &error, uint64_t *error_row=nullptr)
Index rows and take ownership of them.
std::string m_parent_field
On-demand walks over the parent links of an indexed array.
Parent, child, depth and subtree structure over rows linked by parent index.
std::optional< ForestIndex > index_composite_forest(const CompositeArray &rows, std::string_view parent_field, std::string &error, uint64_t *error_row)
Index the parent links of a Composite array.
std::optional< Region > forest_subtree_region(const ForestIndex &index, size_t row)
One-axis Region covering the subtree of row, inclusive.
std::optional< CompositeArray > copy_forest_subtree(const CompositeArray &rows, const ForestIndex &index, std::string_view parent_field, size_t row, std::string &error)
Copy the subtree of row into a self-contained array.