本文整理汇总了C++中model::leaves方法的典型用法代码示例。如果您正苦于以下问题:C++ model::leaves方法的具体用法?C++ model::leaves怎么用?C++ model::leaves使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model::leaves方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: i
void generalization_indexer::
populate(const generalization_details& d, model& m) const {
for (const auto& pair : d.leaves) {
const auto& n(pair.first);
auto i(m.objects().find(n));
if (i == m.objects().end()) {
const auto qn(n.qualified());
BOOST_LOG_SEV(lg, error) << object_not_found << qn;
BOOST_THROW_EXCEPTION(indexing_error(object_not_found + qn));
}
const auto rt(relationship_types::leaves);
i->second.relationships()[rt] = pair.second;
i->second.relationships()[rt].sort();
const auto omn(m.name().location().original_model_name());
for (const auto& l : pair.second) {
if (l.location().original_model_name() == omn)
m.leaves().insert(l);
}
}
for (const auto& pair : d.original_parents) {
const auto& n(pair.first);
auto i(m.objects().find(n));
if (i == m.objects().end()) {
const auto qn(n.qualified());
BOOST_LOG_SEV(lg, error) << object_not_found << qn;
BOOST_THROW_EXCEPTION(indexing_error(object_not_found + qn));
}
auto& o(i->second);
if (!o.is_child()) {
// a bit of a hack, top-level types have themselves as the
// original parent of the container just to make our life easier
BOOST_LOG_SEV(lg, debug) << "Type has parents but is not a child: "
<< n.qualified();
continue;
}
const auto rt(relationship_types::original_parents);
o.relationships()[rt] = pair.second;
for (const auto& opn : pair.second) {
const auto j(m.objects().find(opn));
if (j == m.objects().end()) {
const auto qn(opn.qualified());
BOOST_LOG_SEV(lg, error) << object_not_found << qn;
BOOST_THROW_EXCEPTION(indexing_error(object_not_found + qn));
}
o.is_original_parent_visitable(j->second.is_visitable());
}
}
}
示例2: add_target
void merger::add_target(const model& target) {
const auto qn(target.name().qualified());
require_not_has_target(qn);
has_target_ = true;
merged_model_.name(target.name());
merged_model_.documentation(target.documentation());
merged_model_.leaves(target.leaves());
merged_model_.modules(target.modules());
merged_model_.references(target.references());
merged_model_.extensions(target.extensions());
merged_model_.is_target(true);
BOOST_LOG_SEV(lg, debug) << "added target model: " << qn;
}
示例3: hash
std::size_t model_hasher::hash(const model& v) {
std::size_t seed(0);
combine(seed, v.documentation());
combine(seed, v.extensions());
combine(seed, v.name());
combine(seed, v.generation_type());
combine(seed, v.origin_type());
combine(seed, hash_boost_optional_dogen_tack_name(v.containing_module()));
combine(seed, hash_std_unordered_map_dogen_tack_name_dogen_tack_origin_types(v.references()));
combine(seed, hash_std_unordered_set_dogen_tack_name(v.leaves()));
combine(seed, hash_std_unordered_map_dogen_tack_name_dogen_tack_module(v.modules()));
combine(seed, hash_std_unordered_map_dogen_tack_name_dogen_tack_concept(v.concepts()));
combine(seed, hash_std_unordered_map_dogen_tack_name_dogen_tack_primitive(v.primitives()));
combine(seed, hash_std_unordered_map_dogen_tack_name_dogen_tack_enumeration(v.enumerations()));
combine(seed, hash_std_unordered_map_dogen_tack_name_dogen_tack_object(v.objects()));
combine(seed, v.is_target());
combine(seed, v.has_generatable_types());
return seed;
}