Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Enforce "Rule-of-Three/Five".
[simgrid.git] / src / smpi / include / smpi_topo.hpp
index d0cb570..35e3196 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-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. */
@@ -17,8 +17,10 @@ namespace smpi{
 class Topo {
   public:
     virtual ~Topo()=default;
-  protected:
-  MPI_Comm comm_;
+    MPI_Comm getComm() const { return comm_; }
+    void setComm(MPI_Comm comm) { comm_ = comm; }
+  private:
+    MPI_Comm comm_;
 };
 
 
@@ -31,6 +33,8 @@ class Topo_Cart: public Topo {
     int *position_;
   public:
     explicit Topo_Cart(int ndims);
+    Topo_Cart(const Topo_Cart&) = delete;
+    Topo_Cart& operator=(const Topo_Cart&) = delete;
     ~Topo_Cart();
     Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart);
     Topo_Cart* sub(const int remain_dims[], MPI_Comm *newcomm) ;
@@ -46,25 +50,25 @@ class Topo_Cart: public Topo {
 class Topo_Graph: public Topo {
   private:
     int nnodes_;
-    int nedges_;
     int *index_;
     int *edges_;
   public:
     Topo_Graph();
+    Topo_Graph(const Topo_Graph&) = delete;
+    Topo_Graph& operator=(const Topo_Graph&) = delete;
     ~Topo_Graph();
 };
 
 class Topo_Dist_Graph: public Topo {
   private:
-    int indegree_;
     int *in_;
     int *in_weights_;
-    int outdegree_;
     int *out_;
     int *out_weights_;
-    int is_weighted_;
   public:
     Topo_Dist_Graph();
+    Topo_Dist_Graph(const Topo_Dist_Graph&) = delete;
+    Topo_Dist_Graph& operator=(const Topo_Dist_Graph&) = delete;
     ~Topo_Dist_Graph();
 };