- void* loopback_ = nullptr;
- kernel::resource::LinkImpl* backbone_ = nullptr;
- NetPoint* router_ = nullptr;
- bool has_limiter_ = false;
- bool has_loopback_ = false;
- unsigned int num_links_per_node_ = 1; /* may be 1 (if only a private link), 2 or 3 (if limiter and loopback) */
+ unsigned int node_pos(int id) const { return id * num_links_per_node_; }
+ unsigned int node_pos_with_loopback(int id) const { return node_pos(id) + (has_loopback_ ? 1 : 0); }
+ unsigned int node_pos_with_loopback_limiter(int id) const
+ {
+ return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0);
+ }
+ /** Fill the leaf retriving netpoint from a user's callback */
+ void fill_leaf_from_cb(unsigned int position, const std::vector<unsigned int>& dimensions,
+ const std::function<s4u::ClusterNetPointCb>& set_netpoint_cb,
+ const std::function<s4u::ClusterLinkCb>& set_loopback_cb,
+ const std::function<s4u::ClusterLinkCb>& set_limiter_cb, NetPoint** node_netpoint,
+ s4u::Link** lb_link, s4u::Link** limiter_link);