std::size_t repository_hasher::hash(const repository& v) { std::size_t seed(0); combine(seed, hash_std_list_dogen_dynamic_field_definition(v.all_field_definitions())); combine(seed, hash_std_unordered_map_std_string_dogen_dynamic_field_definition(v.field_definitions_by_name())); combine(seed, hash_std_unordered_map_std_string_std_list_dogen_dynamic_field_definition_(v.field_definitions_by_facet_name())); combine(seed, hash_std_unordered_map_std_string_std_list_dogen_dynamic_field_definition_(v.field_definitions_by_formatter_name())); combine(seed, hash_std_unordered_map_std_string_std_list_dogen_dynamic_field_definition_(v.field_definitions_by_model_name())); return seed; }
void mock_repository_factory::add_field_definition( const field_definition& fd, repository& rp) const { const auto n(fd.name().qualified()); const auto pair(std::make_pair(n, fd)); const auto result(rp.field_definitions_by_name().insert(pair)); if (!result.second) { BOOST_LOG_SEV(lg, error) << duplicate_qualified_name << n; BOOST_THROW_EXCEPTION(workflow_error(duplicate_qualified_name + n)); } const auto& oh(fd.ownership_hierarchy()); rp.field_definitions_by_facet_name()[oh.facet_name()].push_back(fd); rp.field_definitions_by_formatter_name()[oh.formatter_name()] .push_back(fd); }