bundle_repository bundle_repository_factory::
make(const dynamic::repository& rp, const dynamic::object& root_object,
    const dogen::formatters::general_settings_factory& gsf,
    const opaque_settings_builder& osb, const sml::model& m) const {

    BOOST_LOG_SEV(lg, debug) << "Creating settings bundle repository.";

    const bundle_factory f(rp, root_object, gsf, osb);
    generator g(f);
    sml::all_model_items_traversal(m, g);
    auto r(g.result());

    // FIXME: hack to handle registars.
    sml::qname qn;
    qn.simple_name(registrar_name);
    qn.model_name(m.name().model_name());
    qn.external_module_path(m.name().external_module_path());

    const auto pair(std::make_pair(qn, f.make()));
    auto& deps(r.bundles_by_qname());
    const auto res(deps.insert(pair));
    if (!res.second) {
        const auto n(sml::string_converter::convert(qn));
        BOOST_LOG_SEV(lg, error) << duplicate_qname << n;
        BOOST_THROW_EXCEPTION(building_error(duplicate_qname + n));
    }

    BOOST_LOG_SEV(lg, debug) << "Finished creating settings bundle repository."
                             << r;
    return r;
}
示例#2
0
bool workflow::has_generatable_types(const sml::model& m) const {
    for (const auto pair : m.objects()) {
        if (is_generatable(pair.second))
            return true;
    }

    for (const auto pair : m.enumerations()) {
        if (is_generatable(pair.second))
            return true;
    }

    for (const auto pair : m.enumerations()) {
        if (is_generatable(pair.second))
            return true;
    }

    return false;
}
示例#3
0
std::list<content_descriptor>
content_descriptor_factory::create(const sml::model& m) const {
    std::list<content_descriptor> r;

    using config::cpp_facet_types;
    const auto ft(cpp_facet_types::types);
    const auto at(aspect_types::main);
    const auto header(file_types::header);
    const auto ct(content_types::namespace_doc);
    r.push_back(content_descriptor(header, ft, at, m.name(), ct));

    return r;
}