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"; }
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; }
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; }