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

◆ instantiate_rows() [2/2]

template<typename Source, typename Access = Reflect::RecordAccess<Source>>
std::optional< std::vector< uint32_t > > MayaFlux::Portal::Forma::instantiate_rows ( const ManifestTables< Source, Access > & tables,
const Source & root,
std::string_view template_id,
const Kakshya::CompositeArray & rows,
Surface & surface,
std::string & error )
nodiscard

instantiate_rows for a document that uses all three tables.

The whole document is checked again before the rows are placed, so a document with elements or on children needs the calls and actions that check reads, and this overload gives them.

Definition at line 883 of file Instantiate.hpp.

887{
888 error.clear();
889 Detail::DocumentWalk<Source, Access> walk(tables.factories, root, error, &tables.actions, &tables.calls);
890 if (!walk.read_structure())
891 return std::nullopt;
892 const auto placers = walk.prepare_bulk(template_id, rows);
893 if (!placers)
894 return std::nullopt;
895
896 std::vector<uint32_t> elements;
897 elements.reserve(placers->size());
898 for (const auto& placer : *placers) {
899 const auto element = placer(surface, error);
900 if (!element)
901 return std::nullopt;
902 elements.push_back(*element);
903 }
904 return elements;
905}
ActionTable< Source, Access > actions
FactoryTable< Source, Access > factories
CallTable< Source, Access > calls

References MayaFlux::Portal::Forma::ManifestTables< Source, Access >::actions, MayaFlux::Portal::Forma::ManifestTables< Source, Access >::calls, MayaFlux::Portal::Forma::ManifestTables< Source, Access >::factories, instantiate_rows(), MayaFlux::Portal::Forma::Detail::DocumentWalk< Source, Access >::prepare_bulk(), and MayaFlux::Portal::Forma::Detail::DocumentWalk< Source, Access >::read_structure().

Here is the call graph for this function: