66
77namespace phlex ::experimental {
88 edge_creation_policy::named_output_port const * edge_creation_policy::find_producer (
9- product_specification const & specified_product_name ) const
9+ product_query const & query ) const
1010 {
11- auto [b, e] = producers_.equal_range (specified_product_name.name ());
11+ auto const & spec = query.name ;
12+ auto [b, e] = producers_.equal_range (spec.name ());
1213 if (b == e) {
1314 return nullptr ;
1415 }
1516 std::map<std::string, named_output_port const *> candidates;
1617 for (auto const & [key, producer] : std::ranges::subrange{b, e}) {
17- if (producer.node .match (specified_product_name .qualifier ())) {
18- if (specified_product_name .type () != producer.type ) {
18+ if (producer.node .match (spec .qualifier ())) {
19+ if (spec .type () != producer.type ) {
1920 spdlog::debug (" Matched {} from {} but types don't match (`{}` vs `{}`)" ,
20- specified_product_name .full (),
21+ spec .full (),
2122 producer.node .full (),
22- specified_product_name .type (),
23+ spec .type (),
2324 producer.type );
2425 } else {
2526 spdlog::debug (" Matched {} from {} and types match (`{}` vs `{}`)" ,
26- specified_product_name .full (),
27+ spec .full (),
2728 producer.node .full (),
28- specified_product_name .type (),
29+ spec .type (),
2930 producer.type );
3031 candidates.emplace (producer.node .full (), &producer);
3132 }
@@ -34,13 +35,12 @@ namespace phlex::experimental {
3435
3536 if (candidates.empty ()) {
3637 throw std::runtime_error (" Cannot identify product matching the specified label " +
37- specified_product_name .full ());
38+ spec .full ());
3839 }
3940
4041 if (candidates.size () > 1ull ) {
4142 std::ostringstream msg;
42- msg << " More than one candidate matches the specified label " << specified_product_name.full ()
43- << " :" ;
43+ msg << " More than one candidate matches the specified label " << spec.full () << " :" ;
4444 for (auto const & key : candidates | std::views::keys) {
4545 msg << " \n - " << key;
4646 }
0 commit comments