From 312fb09ad52ce2677ad845a760d477b688a30d2c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 15 Oct 2016 10:52:20 +0200 Subject: [PATCH] make some field private, to please sonar Sonar rational is that protected fields are the sign of a logic that spreads over all sub-classes. I tend to strongly agree with this point. --- include/simgrid/s4u/As.hpp | 11 ++++++----- src/surf/sg_platf.cpp | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/simgrid/s4u/As.hpp b/include/simgrid/s4u/As.hpp index 6758f4e19a..a02359d54e 100644 --- a/include/simgrid/s4u/As.hpp +++ b/include/simgrid/s4u/As.hpp @@ -58,15 +58,16 @@ public: void addBypassRoute(sg_platf_route_cbarg_t e_route); protected: - As* father_ = nullptr; - char *name_ = nullptr; - xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes std::vector vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex) - std::map, std::vector*> bypassRoutes_; // srcName x dstName -> route - private: + As* father_ = nullptr; + char* name_ = nullptr; + bool sealed_ = false; // We cannot add more content when sealed + + std::map, std::vector*> bypassRoutes_; // srcName x dstName -> route + xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes }; }}; // Namespace simgrid::s4u diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 65e6254053..21d0d8c0f9 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -851,7 +851,9 @@ simgrid::s4u::As * sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS) case A_surfxml_AS_routing_Vivaldi: new_as = new simgrid::kernel::routing::AsVivaldi(current_routing, AS->id); break; - default: xbt_die("Not a valid model!"); break; + default: + xbt_die("Not a valid model!"); + break; } /* make a new routing component */ -- 2.20.1