本文整理汇总了C++中intermediate_model::exceptions方法的典型用法代码示例。如果您正苦于以下问题:C++ intermediate_model::exceptions方法的具体用法?C++ intermediate_model::exceptions怎么用?C++ intermediate_model::exceptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类intermediate_model
的用法示例。
在下文中一共展示了intermediate_model::exceptions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inject_global_module
void containment_expander::inject_global_module(intermediate_model& im) {
BOOST_LOG_SEV(lg, debug) << "Injecting global module for: "
<< im.name().id();
const auto gm(create_global_module(im.origin_type()));
const auto gmn(gm.name());
const auto i(im.modules().find(gmn.id()));
if (i != im.modules().end()) {
const auto id(im.name().id());
BOOST_LOG_SEV(lg, error) << model_already_has_global_module << id;
BOOST_THROW_EXCEPTION(
injection_error(model_already_has_global_module + id));
}
im.modules().insert(std::make_pair(gmn.id(), gm));
add_containing_module_to_non_contained_entities(gmn, im.modules());
add_containing_module_to_non_contained_entities(gmn, im.concepts());
add_containing_module_to_non_contained_entities(gmn, im.primitives());
add_containing_module_to_non_contained_entities(gmn, im.enumerations());
add_containing_module_to_non_contained_entities(gmn, im.objects());
add_containing_module_to_non_contained_entities(gmn, im.exceptions());
add_containing_module_to_non_contained_entities(gmn, im.visitors());
BOOST_LOG_SEV(lg, debug) << "Done injecting global module";
}
示例2: uf
void dehydrator::
dehydrate_exceptions(const intermediate_model& im, std::ostream& s) const {
using boost::algorithm::join;
formatters::utility_formatter uf(s);
bool output_comma(!im.objects().empty() || !im.concepts().empty() ||
im.modules().empty() || im.modules().empty() ||
im.enumerations().empty());
const auto exceptions(to_map(im.exceptions()));
for (const auto& pair : exceptions) {
if (output_comma)
s << comma_space;
const auto& o(pair.second);
s << " { ";
dehydrate_element(im, o, "exception", s);
s << " }";
output_comma = true;
}
}
示例3: 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, v.original_model_name());
combine(seed, v.generation_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, v.is_target());
combine(seed, v.has_generatable_types());
return seed;
}
示例4: inject_global_module
void injector::inject_global_module(intermediate_model& m) {
const auto gm(create_global_module());
const auto gmn(gm.name());
const auto i(m.modules().find(gmn.qualified()));
if (i != m.modules().end()) {
const auto qn(m.name().qualified());
BOOST_LOG_SEV(lg, error) << model_already_has_global_module << qn;
BOOST_THROW_EXCEPTION(injection_error(
model_already_has_global_module + qn));
}
m.modules().insert(std::make_pair(gmn.qualified(), gm));
add_containing_module_to_non_contained_entities(gmn, m.modules());
add_containing_module_to_non_contained_entities(gmn, m.concepts());
add_containing_module_to_non_contained_entities(gmn, m.primitives());
add_containing_module_to_non_contained_entities(gmn, m.enumerations());
add_containing_module_to_non_contained_entities(gmn, m.objects());
add_containing_module_to_non_contained_entities(gmn, m.exceptions());
add_containing_module_to_non_contained_entities(gmn, m.visitors());
}
示例5: elements_traversal
inline void elements_traversal(intermediate_model& m, TraversalVisitor& v) {
for (auto& pair : m.modules())
v(pair.second);
for (auto& pair : m.concepts())
v(pair.second);
for (auto& pair : m.primitives())
v(pair.second);
for (auto& pair : m.enumerations())
v(pair.second);
for (auto& pair : m.objects())
v(pair.second);
for (auto& pair : m.exceptions())
v(pair.second);
for (auto& pair : m.visitors())
v(pair.second);
}
示例6: 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;
}