MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kakshya::CompositeForest Class Reference

A Composite array together with the index of its parent links. More...

#include <CompositeForest.hpp>

Collaboration diagram for MayaFlux::Kakshya::CompositeForest:

Public Member Functions

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 ForestIndex & index () const noexcept
 The index of the owned rows.
const CompositeArray & rows () const noexcept
 The owned rows.
std::optional< Region > subtree_region (size_t row) const
 Region covering the subtree of row, or nullopt as forest_subtree_region.
DataForestTraversal< CompositeArray > traversal () const noexcept
 A traversal borrowing the owned rows and index.

Static Public Member Functions

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.

Private Member Functions

 CompositeForest (CompositeArray rows, ForestIndex index, std::string parent_field)

Private Attributes

ForestIndex m_index
std::string m_parent_field
CompositeArray m_rows

Detailed Description

A Composite array together with the index of its parent links.

Owns both so a hierarchical document can be held, shared and walked without a separate reader or tree copy. Instances are immutable and shared, which keeps the array at a stable address for borrowed views.

Usage:

auto forest = CompositeForest::build(std::move(rows), "parent", error);
auto traversal = forest->traversal();
auto branch = forest->subtree_region(3);
DataForestTraversal< CompositeArray > traversal() const noexcept
A traversal borrowing the owned rows and index.
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.

Definition at line 68 of file CompositeForest.hpp.


The documentation for this class was generated from the following files: