当前位置: 首页>>代码示例>>C++>>正文


C++ intermediate_model::indices方法代码示例

本文整理汇总了C++中intermediate_model::indices方法的典型用法代码示例。如果您正苦于以下问题:C++ intermediate_model::indices方法的具体用法?C++ intermediate_model::indices怎么用?C++ intermediate_model::indices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在intermediate_model的用法示例。


在下文中一共展示了intermediate_model::indices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dehydrate_annotations

void dehydrator::dehydrate_annotations(const intermediate_model& im,
    const std::string& id, std::ostream& s) const {

    formatters::utility_formatter uf(s);
    bool has_annotations(false);
    const auto& scribble_groups(im.indices().scribble_groups());
    const auto i(scribble_groups.find(id));
    if (i == scribble_groups.end())
        return;

    bool is_first(true);
    const auto scribble(i->second.parent());
    has_annotations = !scribble.entries().empty();
    if (!has_annotations)
        return;

    s << comma_space;
    uf.insert_quoted("annotation");
    s << " : {";

    for (const auto& entry : scribble.entries()) {
        if (!is_first)
            s << ", ";
        uf.insert_quoted(entry.first);
        s << " : ";
        uf.insert_quoted(entry.second);
        is_first = false;
    }
    s << " }";
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例2: hash

std::size_t intermediate_model_hasher::hash(const intermediate_model& v) {
    std::size_t seed(0);

    combine(seed, v.name());
    combine(seed, v.origin_type());
    combine(seed, hash_std_unordered_map_dogen_yarn_name_dogen_yarn_origin_types(v.references()));
    combine(seed, hash_std_unordered_set_dogen_yarn_name(v.leaves()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_module(v.modules()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_concept(v.concepts()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_primitive(v.primitives()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_enumeration(v.enumerations()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_object(v.objects()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_exception(v.exceptions()));
    combine(seed, hash_std_unordered_map_std_string_dogen_yarn_visitor(v.visitors()));
    combine(seed, hash_std_unordered_map_std_string_boost_shared_ptr_dogen_yarn_element(v.injected_elements()));
    combine(seed, v.has_generatable_types());
    combine(seed, v.indices());
    combine(seed, v.root_module());
    combine(seed, v.language());

    return seed;
}
开发者ID:,项目名称:,代码行数:22,代码来源:


注:本文中的intermediate_model::indices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。