Exemplo n.º 1
0
std::forward_list<std::shared_ptr<formattables::formattable> >
workflow::from_factory_activity(const config::cpp_options& opts,
    const dynamic::object& root_object,
    const dogen::formatters::general_settings_factory& gsf,
    settings::bundle_repository& brp,
    const std::unordered_map<std::string, settings::path_settings>& ps,
    const formattables::path_derivatives_repository& pdrp,
    formatter_properties_repository& fprp,
    const formatters::container& fc,
    const yarn::model& m) const {

    const auto& formatters(fc.all_formatters());
    std::forward_list<std::shared_ptr<formattables::formattable> > r;
    factory f;
    const auto& ro(root_object);
    const auto ri(f.make_registrar_info(opts, brp, ps, fprp, m));
    if (ri)
        r.push_front(ri);

    r.splice_after(r.before_begin(),
        f.make_includers(opts, ro, gsf, brp, ps, pdrp, formatters, fprp, m));
    r.splice_after(r.before_begin(),
        f.make_cmakelists(opts, ro, gsf, ps, fprp, m));

    const auto oi(f.make_odb_options(opts, ro, gsf, ps, fprp, m));
    if (oi)
        r.push_front(oi);

    BOOST_LOG_SEV(lg, debug) << "Factory formattables: " << r;
    return r;
}
Exemplo n.º 2
0
std::unordered_map<std::string, enablement_factory::field_definitions>
enablement_factory::create_field_definitions(
    const dynamic::repository& rp,
    const formatters::container& fc) const {
    const dynamic::repository_selector s(rp);

    std::unordered_map<std::string, field_definitions> r;
    for (const auto& f : fc.all_formatters()) {
        field_definitions fd;
        const auto oh(f->ownership_hierarchy());
        const auto& fn(oh.formatter_name());
        fd.enabled = s.select_field_by_name(fn, traits::enabled());

        const auto& fctn(oh.facet_name());
        fd.supported = s.select_field_by_name(fctn, traits::supported());
        r[fn] = fd;
    }
    return r;
}