- unsigned int node_pos(int id) { return id * num_links_per_node_; }
- unsigned int node_pos_with_loopback(int id) { return node_pos(id) + (has_loopback_ ? 1 : 0); }
- unsigned int node_pos_with_loopback_limiter(int id) { return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0); }
+ void set_loopback();
+ bool has_loopback() const { return has_loopback_; }
+ void set_limiter();
+ bool has_limiter() const { return has_limiter_; }
+ void set_backbone(resource::StandardLinkImpl* bb) { backbone_ = bb; }
+ bool has_backbone() const { return backbone_ != nullptr; }
+ void set_router(NetPoint* router) { router_ = router; }
+ /** @brief Sets gateway for the leaf */
+ void set_gateway(unsigned long position, NetPoint* gateway);
+ /** @brief Gets gateway for the leaf or nullptr */
+ NetPoint* get_gateway(unsigned long position);
+ void add_private_link_at(unsigned long position,
+ std::pair<resource::StandardLinkImpl*, resource::StandardLinkImpl*> link);
+ bool private_link_exists_at(unsigned long position) const
+ {
+ return private_links_.find(position) != private_links_.end();
+ }
+
+ unsigned long node_pos(unsigned long id) const { return id * num_links_per_node_; }
+ unsigned long node_pos_with_loopback(unsigned long id) const { return node_pos(id) + (has_loopback_ ? 1 : 0); }