- /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
- static xbt::signal<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>
- on_communication_state_change;
+/**
+ * @beginrst
+ * Another encapsulation for using links in the :cpp:func:`NetZone::add_route`
+ *
+ * When adding a route with split-duplex links, you need to specify the direction of the link
+ * so SimGrid can know exactly which physical link to insert in the route.
+ *
+ * For shared/fat-pipe links, use the :cpp:enumerator:`Direction::NONE` since they don't have
+ * the concept of UP/DOWN links.
+ * @endrst
+ */
+class XBT_PUBLIC LinkInRoute {
+public:
+ enum class Direction { UP = 2, DOWN = 1, NONE = 0 };
+
+ explicit LinkInRoute(const Link* link) : link_(link) {}
+ LinkInRoute(const Link* link, Direction d) : link_(link), direction_(d) {}
+
+ /** @brief Get direction of this link in the route: UP or DOWN */
+ Direction get_direction() const { return direction_; }
+ /** @brief Get pointer to the link */
+ const Link* get_link() const { return link_; }
+
+private:
+ const Link* link_;
+ Direction direction_ = Direction::NONE;