本文整理汇总了C++中model::primitives方法的典型用法代码示例。如果您正苦于以下问题:C++ model::primitives方法的具体用法?C++ model::primitives怎么用?C++ model::primitives使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model::primitives方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: post_process
void json_hydrator::post_process(model& m) const {
update_containing_module(m, m.objects());
update_containing_module(m, m.primitives());
update_containing_module(m, m.enumerations());
update_containing_module(m, m.concepts());
update_containing_module(m, m.modules());
}
示例2: expand_containing_module
void modules_expander::expand_containing_module(model& m) const {
update_containing_module(m, m.objects());
update_containing_module(m, m.primitives());
update_containing_module(m, m.enumerations());
update_containing_module(m, m.concepts());
update_containing_module(m, m.modules());
}
示例3: merge_model
void merger::merge_model(const model& m) {
BOOST_LOG_SEV(lg, info) << "Merging model: '"
<< m.name().qualified()
<< " modules: " << m.modules().size()
<< " concepts: " << m.concepts().size()
<< " primitives: " << m.primitives().size()
<< " enumerations: " << m.enumerations().size()
<< " objects: " << m.objects().size();
const auto mn(m.name().location().original_model_name());
for (const auto& c : m.concepts()) {
check_name(mn, c.first, c.second.name());
merged_model_.concepts().insert(c);
}
for (const auto& pair : m.primitives()) {
// FIXME: mega hack to handle primitive model.
const auto pmn(mn == hardware_model_name ? empty : mn);
check_name(pmn, pair.first, pair.second.name());
merged_model_.primitives().insert(pair);
}
for (const auto& pair : m.enumerations()) {
check_name(mn, pair.first, pair.second.name());
merged_model_.enumerations().insert(pair);
}
for (const auto& pair : m.objects()) {
check_name(mn, pair.first, pair.second.name());
merged_model_.objects().insert(pair);
}
for (const auto& pair : m.modules()) {
if (!pair.first.simple().empty())
check_name(mn, pair.first, pair.second.name());
merged_model_.modules().insert(pair);
}
}
示例4: simple_name_value
void json_hydrator::
read_element(const boost::property_tree::ptree& pt, model& m) const {
qname qn;
qn.model_name(model_name(m));
read_module_path(pt, m, qn);
const auto simple_name_value(pt.get<std::string>(simple_name_key));
qn.simple_name(simple_name_value);
const auto documentation(pt.get_optional<std::string>(documentation_key));
const auto lambda([&](type& t) {
BOOST_LOG_SEV(lg, debug) << "Processing type: "
<< sml::string_converter::convert(qn);
t.name(qn);
t.origin_type(m.origin_type());
t.generation_type(m.generation_type());
if (documentation)
t.documentation(*documentation);
const auto scope(dynamic::scope_types::entity);
t.extensions(create_dynamic_extensions(pt, scope));
});
const auto meta_type_value(pt.get<std::string>(meta_type_key));
if (meta_type_value == meta_type_object_value) {
object o;
lambda(o);
const auto ot(pt.get_optional<std::string>(object_type_key));
o.object_type(to_object_type(ot));
m.objects().insert(std::make_pair(qn, o));
} else if (meta_type_value == meta_type_primitive_value) {
primitive p;
lambda(p);
m.primitives().insert(std::make_pair(qn, p));
}
else {
BOOST_LOG_SEV(lg, error) << invalid_meta_type << meta_type_value;
BOOST_THROW_EXCEPTION(
hydration_error(invalid_meta_type + meta_type_value));
}
}
示例5: 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;
}