- /* PRECONDITION: this is the common ancestor of src and dst */
- bool AsImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
- /* OUT */ std::vector<surf::Link*>* links, double* latency)
- {
- // If never set a bypass route return nullptr without any further computations
- XBT_DEBUG("generic_get_bypassroute from %s to %s", src->name(), dst->name());
- if (bypassRoutes_.empty())
- return false;
-
- /* Base case, no recursion is needed */
- if(dst->containingAS() == this && src->containingAS() == this ){
- if (bypassRoutes_.find({src->name(),dst->name()}) != bypassRoutes_.end()) {
- std::vector<surf::Link*>* bypassedRoute = bypassRoutes_.at({src->name(), dst->name()});
- for (surf::Link* link : *bypassedRoute) {
- links->push_back(link);
- if (latency)
- *latency += link->latency();
- }
- XBT_DEBUG("Found a bypass route with %zu links",bypassedRoute->size());
- return true;
+ /* PRECONDITION: this is the common ancestor of src and dst */
+ bool AsImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
+ /* OUT */ std::vector<surf::Link*>* links, double* latency)
+ {
+ // If never set a bypass route return nullptr without any further computations
+ XBT_DEBUG("generic_get_bypassroute from %s to %s", src->name().c_str(), dst->name().c_str());
+ if (bypassRoutes_.empty())
+ return false;
+
+ /* Base case, no recursion is needed */
+ if (dst->containingAS() == this && src->containingAS() == this) {
+ if (bypassRoutes_.find({src, dst}) != bypassRoutes_.end()) {
+ std::vector<surf::Link*>* bypassedRoute = bypassRoutes_.at({src, dst});
+ for (surf::Link* link : *bypassedRoute) {
+ links->push_back(link);
+ if (latency)
+ *latency += link->latency();