|
1 | 1 | /* |
2 | | - Copyright (c) 2005-2024 Intel Corporation |
| 2 | + Copyright (c) 2005-2025 Intel Corporation |
| 3 | + Copyright (c) 2025 UXL Foundation Contributors |
3 | 4 |
|
4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 6 | you may not use this file except in compliance with the License. |
|
1458 | 1459 | // join base class type generator |
1459 | 1460 | template<template<class> class PT, typename OutputTuple, typename JP> |
1460 | 1461 | struct join_base { |
1461 | | - typedef join_node_base<JP, typename wrap_tuple_elements<PT,OutputTuple>::type, OutputTuple> type; |
| 1462 | + using type = join_node_base<JP, typename wrap_tuple_elements<PT, OutputTuple>::type, OutputTuple>; |
1462 | 1463 | }; |
1463 | 1464 |
|
1464 | 1465 | template<typename OutputTuple, typename K, typename KHash> |
1465 | 1466 | struct join_base<key_matching_port, OutputTuple, key_matching<K,KHash> > { |
1466 | | - typedef key_matching<K, KHash> key_traits_type; |
1467 | | - typedef K key_type; |
1468 | | - typedef KHash key_hash_compare; |
1469 | | - typedef join_node_base< key_traits_type, |
1470 | | - // ports type |
1471 | | - typename wrap_key_tuple_elements<key_matching_port,key_traits_type,OutputTuple>::type, |
1472 | | - OutputTuple > type; |
1473 | | - }; |
| 1467 | + using key_type = K; |
| 1468 | + using key_hash_compare = KHash; |
| 1469 | + using key_traits_type = key_matching<key_type, key_hash_compare>; |
1474 | 1470 |
|
1475 | | - //! unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type |
1476 | | - // using tuple_element. The class PT is the port type (reserving_port, queueing_port, key_matching_port) |
1477 | | - // and should match the typename. |
1478 | | - |
1479 | | - template<int M, template<class> class PT, typename OutputTuple, typename JP> |
1480 | | - class unfolded_join_node : public join_base<M,PT,OutputTuple,JP>::type { |
1481 | | - public: |
1482 | | - typedef typename wrap_tuple_elements<M, PT, OutputTuple>::type input_ports_type; |
1483 | | - typedef OutputTuple output_type; |
1484 | | - private: |
1485 | | - typedef join_node_base<JP, input_ports_type, output_type > base_type; |
1486 | | - public: |
1487 | | - unfolded_join_node(graph &g) : base_type(g) {} |
1488 | | - unfolded_join_node(const unfolded_join_node &other) : base_type(other) {} |
| 1471 | + using type = join_node_base<key_traits_type, |
| 1472 | + // ports type |
| 1473 | + typename wrap_key_tuple_elements<key_matching_port, key_traits_type, OutputTuple>::type, |
| 1474 | + OutputTuple>; |
1489 | 1475 | }; |
1490 | 1476 |
|
1491 | 1477 | #if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING |
|
1504 | 1490 | }; |
1505 | 1491 | #endif /* __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING */ |
1506 | 1492 |
|
1507 | | - //! unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type |
1508 | | - // using tuple_element. The class PT is the port type (reserving_port, queueing_port, key_matching_port) |
| 1493 | + //! unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type |
| 1494 | + // using tuple_element. The class PortType is the port type (reserving_port, queueing_port, key_matching_port) |
1509 | 1495 | // and should match the typename. |
1510 | | - |
1511 | | - template<template<class> class PT, typename OutputTuple, typename JP> |
1512 | | - class unfolded_join_node : public join_base<PT, OutputTuple, JP>::type { |
| 1496 | + template<template<class> class PortType, typename OutputTuple, typename JoinPolicy> |
| 1497 | + class unfolded_join_node : public join_base<PortType, OutputTuple, JoinPolicy>::type { |
1513 | 1498 | public: |
1514 | | - using input_ports_type = typename wrap_tuple_elements<PT, OutputTuple>::type; |
| 1499 | + using input_ports_type = typename wrap_tuple_elements<PortType, OutputTuple>::type; |
1515 | 1500 | using output_type = OutputTuple; |
1516 | 1501 | private: |
1517 | | - using base_type = join_node_base<JP, input_ports_type, output_type>; |
| 1502 | + using base_type = join_node_base<JoinPolicy, input_ports_type, output_type>; |
1518 | 1503 | public: |
1519 | 1504 | unfolded_join_node(graph& g) : base_type(g) {} |
1520 | 1505 | unfolded_join_node(const unfolded_join_node &other) : base_type(other) {} |
1521 | 1506 | }; |
1522 | 1507 |
|
1523 | 1508 | // key_matching unfolded_join_node. This must be a separate specialization because the constructors |
1524 | 1509 | // differ. |
1525 | | - |
1526 | 1510 | template<typename K, typename KHash, typename...Types> |
1527 | 1511 | class unfolded_join_node<key_matching_port, std::tuple<Types...>, key_matching<K, KHash>> |
1528 | 1512 | : public join_base<key_matching_port, std::tuple<Types...>, key_matching<K, KHash>>::type |
|
0 commit comments