Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Remove custom destructors for routing/DragonflyZone.
[simgrid.git] / include / simgrid / kernel / routing / DragonflyZone.hpp
index b25af86..9144e16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
@@ -18,12 +18,11 @@ public:
   unsigned int group_;
   unsigned int chassis_;
   unsigned int blade_;
-  resource::LinkImpl** blue_links_  = nullptr;
-  resource::LinkImpl** black_links_ = nullptr;
-  resource::LinkImpl** green_links_ = nullptr;
-  resource::LinkImpl** my_nodes_    = nullptr;
-  DragonflyRouter(int i, int j, int k);
-  ~DragonflyRouter();
+  resource::LinkImpl* blue_link_ = nullptr;
+  std::vector<resource::LinkImpl*> black_links_;
+  std::vector<resource::LinkImpl*> green_links_;
+  std::vector<resource::LinkImpl*> my_nodes_;
+  DragonflyRouter(unsigned group, unsigned chassis, unsigned blade) : group_(group), chassis_(chassis), blade_(blade) {}
 };
 
 /** @ingroup ROUTING_API
@@ -61,19 +60,19 @@ public:
  */
 class XBT_PUBLIC DragonflyZone : public ClusterZone {
 public:
-  explicit DragonflyZone(NetZone* father, std::string name);
-  ~DragonflyZone() override;
+  explicit DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
   void seal() override;
-  void generateRouters();
-  void generateLinks();
-  void createLink(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
 
   void rankId_to_coords(int rank_id, unsigned int coords[4]);
 
 private:
+  void generate_routers();
+  void generate_links();
+  void create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
+
   simgrid::s4u::Link::SharingPolicy sharing_policy_;
   double bw_  = 0;
   double lat_ = 0;
@@ -86,7 +85,7 @@ private:
   unsigned int num_links_black_        = 0;
   unsigned int num_links_blue_         = 0;
   unsigned int num_links_per_link_     = 1; // splitduplex -> 2, only for local link
-  DragonflyRouter** routers_        = nullptr;
+  std::vector<DragonflyRouter> routers_;
 };
 } // namespace routing
 } // namespace kernel