本文整理汇总了C++中model::name方法的典型用法代码示例。如果您正苦于以下问题:C++ model::name方法的具体用法?C++ model::name怎么用?C++ model::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model::name方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
void merger::add(const model& m) {
require_not_has_merged();
if (m.is_target())
add_target(m);
BOOST_LOG_SEV(lg, debug) << "adding model: "
<< m.name().qualified();
BOOST_LOG_SEV(lg, debug) << "contents: " << m;
models_.insert(std::make_pair(m.name(), m));
}
示例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: i
boost::optional<qname> containing_module(model& m, const qname& qn) {
if (qn.model_name().empty() || qn.simple_name() == m.name().model_name()) {
BOOST_LOG_SEV(lg, debug) << "Type has no containing module: "
<< string_converter::convert(qn);
return boost::optional<qname>();
}
qname module_qn;
module_qn.model_name(qn.model_name());
if (qn.module_path().empty()) {
module_qn.simple_name(qn.model_name());
} else {
module_qn.simple_name(qn.module_path().back());
module_qn.module_path(qn.module_path());
module_qn.module_path().pop_back();
}
const auto i(m.modules().find(module_qn));
if (i != m.modules().end())
return module_qn;
BOOST_LOG_SEV(lg, debug) << "Could not find containing module: "
<< string_converter::convert(module_qn);
return boost::optional<qname>();;
}
示例4: 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());
}
}
}
示例5: 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);
}
}
示例6: 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;
}
示例7: model_name
std::string json_hydrator::model_name(const model& m) const {
if (m.name().model_name() == hardware_model_name)
return empty;
return m.name().model_name();
}