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

◆ build()

std::shared_ptr< const CompositeForest > MayaFlux::Kakshya::CompositeForest::build ( CompositeArray rows,
std::string_view parent_field,
std::string & error,
uint64_t * error_row = nullptr )
staticnodiscard

Index rows and take ownership of them.

Parameters
rowsArray with a uint64_t parent field.
parent_fieldName of the parent field.
Returns
The forest, or nullptr with the reason in error.

Definition at line 68 of file CompositeForest.cpp.

71{
72 auto index = index_composite_forest(rows, parent_field, error, error_row);
73 if (!index)
74 return nullptr;
75 return std::shared_ptr<const CompositeForest>(
76 new CompositeForest(std::move(rows), std::move(*index), std::string(parent_field)));
77}
CompositeForest(CompositeArray rows, ForestIndex index, std::string parent_field)
const ForestIndex & index() const noexcept
The index of the owned rows.
const CompositeArray & rows() const noexcept
The owned rows.
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.

References CompositeForest(), index(), MayaFlux::Kakshya::index_composite_forest(), and rows().

Referenced by MayaFlux::IO::XmlDocument::from_rows().

Here is the call graph for this function:
Here is the caller graph for this function: