From: Martin Quinson Date: Sat, 15 Oct 2016 15:21:04 +0000 (+0200) Subject: reindent, no real change X-Git-Tag: v3_14~328 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fe2ef0beabed3e2300620e8d495e1293fc77865c reindent, no real change --- diff --git a/src/s4u/s4u_as.cpp b/src/s4u/s4u_as.cpp index a86951c5b1..5f159a5d3b 100644 --- a/src/s4u/s4u_as.cpp +++ b/src/s4u/s4u_as.cpp @@ -19,88 +19,85 @@ namespace simgrid { As::As(As* father, const char* name) : father_(father), name_(xbt_strdup(name)) { - } - void As::seal() - { - sealed_ = true; - } - As::~As() - { - xbt_dict_cursor_t cursor = nullptr; - char *key; - AS_t elem; - xbt_dict_foreach(children_, cursor, key, elem) { - delete (As*)elem; - } - - - xbt_dict_free(&children_); - for (auto &kv : bypassRoutes_) - delete kv.second; - xbt_free(name_); - } - - xbt_dict_t As::children() - { - return children_; - } - char *As::name() - { - return name_; - } - As *As::father() { - return father_; - } + } + void As::seal() + { + sealed_ = true; + } + As::~As() + { + xbt_dict_cursor_t cursor = nullptr; + char* key; + AS_t elem; + xbt_dict_foreach(children_, cursor, key, elem) { delete (As*)elem; } + + xbt_dict_free(&children_); + for (auto& kv : bypassRoutes_) + delete kv.second; + xbt_free(name_); + } + + xbt_dict_t As::children() + { + return children_; + } + char* As::name() + { + return name_; + } + As* As::father() + { + return father_; + } - xbt_dynar_t As::hosts() - { - xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr); + xbt_dynar_t As::hosts() + { + xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr); - for (auto card : vertices_) { - s4u::Host *host = simgrid::s4u::Host::by_name_or_null(card->name()); - if (host!=nullptr) - xbt_dynar_push(res, &host); - } - return res; + for (auto card : vertices_) { + s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name()); + if (host != nullptr) + xbt_dynar_push(res, &host); } + return res; + } - int As::addComponent(kernel::routing::NetCard *elm) { - vertices_.push_back(elm); - return vertices_.size()-1; // The rank of the newly created object - } + int As::addComponent(kernel::routing::NetCard* elm) + { + vertices_.push_back(elm); + return vertices_.size() - 1; // The rank of the newly created object + } - void As::addRoute(sg_platf_route_cbarg_t /*route*/){ - xbt_die("AS %s does not accept new routes (wrong class).",name_); - } + void As::addRoute(sg_platf_route_cbarg_t /*route*/) + { + xbt_die("AS %s does not accept new routes (wrong class).", name_); + } - void As::addBypassRoute(sg_platf_route_cbarg_t e_route){ - /* Argument validity checks */ - if (e_route->gw_dst) { - XBT_DEBUG("Load bypassASroute from %s@%s to %s@%s", - e_route->src->name(), e_route->gw_src->name(), - e_route->dst->name(), e_route->gw_dst->name()); - xbt_assert(!e_route->link_list->empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", - e_route->src->name(), e_route->gw_src->name(), - e_route->dst->name(), e_route->gw_dst->name()); - xbt_assert(bypassRoutes_.find({e_route->src->name(),e_route->dst->name()}) == bypassRoutes_.end(), - "The bypass route between %s@%s and %s@%s already exists.", - e_route->src->name(), e_route->gw_src->name(), e_route->dst->name(), e_route->gw_dst->name()); - } else { - XBT_DEBUG("Load bypassRoute from %s to %s", e_route->src->name(), e_route->dst->name()); - xbt_assert(!e_route->link_list->empty(), "Bypass route between %s and %s cannot be empty.", - e_route->src->name(), e_route->dst->name()); - xbt_assert(bypassRoutes_.find({e_route->src->name(),e_route->dst->name()}) == bypassRoutes_.end(), - "The bypass route between %s and %s already exists.", - e_route->src->name(), e_route->dst->name()); - } - - /* Build a copy that will be stored in the dict */ - std::vector *newRoute = new std::vector(); - for (auto link: *e_route->link_list) - newRoute->push_back(link); - - /* Store it */ - bypassRoutes_.insert({{e_route->src->name(),e_route->dst->name()}, newRoute}); + void As::addBypassRoute(sg_platf_route_cbarg_t e_route) + { + /* Argument validity checks */ + if (e_route->gw_dst) { + XBT_DEBUG("Load bypassASroute from %s@%s to %s@%s", e_route->src->name(), e_route->gw_src->name(), + e_route->dst->name(), e_route->gw_dst->name()); + xbt_assert(!e_route->link_list->empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", + e_route->src->name(), e_route->gw_src->name(), e_route->dst->name(), e_route->gw_dst->name()); + xbt_assert(bypassRoutes_.find({e_route->src->name(), e_route->dst->name()}) == bypassRoutes_.end(), + "The bypass route between %s@%s and %s@%s already exists.", e_route->src->name(), + e_route->gw_src->name(), e_route->dst->name(), e_route->gw_dst->name()); + } else { + XBT_DEBUG("Load bypassRoute from %s to %s", e_route->src->name(), e_route->dst->name()); + xbt_assert(!e_route->link_list->empty(), "Bypass route between %s and %s cannot be empty.", e_route->src->name(), + e_route->dst->name()); + xbt_assert(bypassRoutes_.find({e_route->src->name(), e_route->dst->name()}) == bypassRoutes_.end(), + "The bypass route between %s and %s already exists.", e_route->src->name(), e_route->dst->name()); } + /* Build a copy that will be stored in the dict */ + std::vector* newRoute = new std::vector(); + for (auto link : *e_route->link_list) + newRoute->push_back(link); + + /* Store it */ + bypassRoutes_.insert({{e_route->src->name(), e_route->dst->name()}, newRoute}); + } } }; // namespace simgrid::s4u