/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
- sg4::Link* l_bb = cluster->create_link("backbone-" + name, "1.25GBps")->seal();
+ const sg4::Link* l_bb = cluster->create_link("backbone-" + name, "1.25GBps")->seal();
+ sg4::LinkInRoute backbone(l_bb);
/* create host */
const sg4::Host* host = cluster->create_host(hostname, "286.087kf");
/* create UP/DOWN link */
/* create host */
const sg4::Host* host = cluster->create_host(hostname, "286.087kf");
/* create UP/DOWN link */
/* add link and backbone for communications from the host */
cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr,
/* add link and backbone for communications from the host */
cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr,
- std::vector<sg4::LinkInRoute>{{link, sg4::LinkInRoute::Direction::UP}, l_bb}, true);
+ {{link, sg4::LinkInRoute::Direction::UP}, backbone}, true);
- sg4::Link* link = root->create_link("backbone", "1.25GBps")->set_latency("24us")->seal();
+ const sg4::Link* l_bb = root->create_link("backbone", "1.25GBps")->set_latency("24us")->seal();
+ sg4::LinkInRoute backbone{l_bb};
rad[rad.size() - 2] = 59;
rad[rad.size() - 3] = 58;
std::tie(cab_zone, router) = create_cabinet(root, "cabinet1", rad);
rad[rad.size() - 2] = 59;
rad[rad.size() - 3] = 58;
std::tie(cab_zone, router) = create_cabinet(root, "cabinet1", rad);
- root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {link});
+ root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {backbone});
/* create cabinet2 */
rad.resize(28);
std::iota(rad.begin(), rad.end(), 30); // 30-57
std::tie(cab_zone, router) = create_cabinet(root, "cabinet2", rad);
/* create cabinet2 */
rad.resize(28);
std::iota(rad.begin(), rad.end(), 30); // 30-57
std::tie(cab_zone, router) = create_cabinet(root, "cabinet2", rad);
- root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {link});
+ root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {backbone});
/* create cabinet3 */
rad.resize(32);
std::iota(rad.begin(), rad.end(), 61); // 61-92
std::tie(cab_zone, router) = create_cabinet(root, "cabinet3", rad);
/* create cabinet3 */
rad.resize(32);
std::iota(rad.begin(), rad.end(), 61); // 61-92
std::tie(cab_zone, router) = create_cabinet(root, "cabinet3", rad);
- root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {link});
+ root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {backbone});