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

◆ prepare_bulk()

template<typename Source, typename Access>
std::optional< std::vector< Placer > > MayaFlux::Portal::Forma::Detail::DocumentWalk< Source, Access >::prepare_bulk ( std::string_view template_id,
const Kakshya::CompositeArray & rows )
inline

Definition at line 166 of file Instantiate.hpp.

168 {
169 const auto found = m_templates.find(std::string(template_id));
170 if (found == m_templates.end()) {
171 m_error = "document has no template " + std::string(template_id);
172 return std::nullopt;
173 }
174 const auto* bulk = m_table.find_bulk(Access::name(found->second));
175 if (!bulk) {
176 fail(found->second, "factory " + std::string(Access::name(found->second))
177 + " has no bulk placement; register it with expose_typed");
178 return std::nullopt;
179 }
180 auto placers = std::invoke(*bulk, found->second, rows, m_error);
181 if (!placers && m_error.empty())
182 fail(found->second, "could not prepare instances");
183 return placers;
184 }
bool fail(const Source &at, std::string message)
std::unordered_map< std::string, Source > m_templates

References fail(), m_error, m_table, and m_templates.

Referenced by MayaFlux::Portal::Forma::instantiate_rows(), and MayaFlux::Portal::Forma::instantiate_rows().

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