namespace kernel {
namespace routing {
-FloydZone::FloydZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
- : RoutedZone(father, name, netmodel)
-{
-}
-
FloydZone::~FloydZone()
{
/* Delete link_table */
cur = pred;
} while (cur != src->id());
- if (hierarchy_ == RoutingMode::recursive) {
+ if (get_hierarchy() == RoutingMode::recursive) {
route->gw_src = route_stack.back()->gw_src;
route->gw_dst = route_stack.front()->gw_dst;
}
while (not route_stack.empty()) {
const RouteCreationArgs* e_route = route_stack.back();
route_stack.pop_back();
- if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
+ if (get_hierarchy() == RoutingMode::recursive && prev_dst_gw != nullptr &&
prev_dst_gw->get_cname() != e_route->gw_src->get_cname()) {
get_global_route(prev_dst_gw, e_route->gw_src, route->link_list, lat);
}
}
void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+ const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
{
/* set the size of table routing */
unsigned int table_size = get_table_size();
"The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->get_cname(),
dst->get_cname());
- TO_FLOYD_LINK(src->id(), dst->id()) = new_extended_route(hierarchy_, gw_src, gw_dst, link_list, true);
+ TO_FLOYD_LINK(src->id(), dst->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, true);
TO_FLOYD_PRED(src->id(), dst->id()) = src->id();
TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list.size();
XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", dst->get_cname(), gw_src->get_cname(),
src->get_cname(), gw_dst->get_cname());
- TO_FLOYD_LINK(dst->id(), src->id()) = new_extended_route(hierarchy_, gw_src, gw_dst, link_list, false);
+ TO_FLOYD_LINK(dst->id(), src->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, false);
TO_FLOYD_PRED(dst->id(), src->id()) = dst->id();
TO_FLOYD_COST(dst->id(), src->id()) =
(TO_FLOYD_LINK(dst->id(), src->id()))->link_list.size(); /* count of links, old model assume 1 */
init_tables(table_size);
/* Add the loopback if needed */
- if (get_network_model()->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (get_network_model()->loopback_ && get_hierarchy() == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
RouteCreationArgs* route = TO_FLOYD_LINK(i, i);
if (not route) {
}
}
}
+} // namespace routing
+} // namespace kernel
+
+namespace s4u {
+NetZone* create_floyd_zone(const std::string& name)
+{
+ return (new kernel::routing::FloydZone(name))->get_iface();
}
-}
-}
+} // namespace s4u
+
+} // namespace simgrid