Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Declare functions 'const'.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 11 Mar 2021 14:10:07 +0000 (15:10 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 11 Mar 2021 14:40:57 +0000 (15:40 +0100)
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_Engine.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp

index 9397c3f..89ea5a5 100644 (file)
@@ -142,7 +142,7 @@ public:
   const std::vector<simgrid::kernel::resource::Model*>& get_model_list(simgrid::kernel::resource::Model::Type type);
 
   /** @brief Get list of all models managed by this engine */
-  const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models();
+  const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models() const;
 
   /** @brief Retrieves all netzones of the type indicated by the template argument */
   template <class T> std::vector<T*> get_filtered_netzones() const
index 9959d37..054c00e 100644 (file)
@@ -85,7 +85,7 @@ const std::vector<simgrid::kernel::resource::Model*>& Engine::get_model_list(sim
   return pimpl->get_model_list(type);
 }
 
-const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models()
+const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models() const
 {
   return pimpl->get_all_models();
 }
index c87e5e0..31147f7 100644 (file)
@@ -113,7 +113,7 @@ s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() const
   return get_constraint()->get_sharing_policy();
 }
 
-void LinkImpl::latency_check(double latency)
+void LinkImpl::latency_check(double latency) const
 {
   static double last_warned_latency = sg_surf_precision;
   if (latency != 0.0 && latency < last_warned_latency) {
index ea4880a..925db91 100644 (file)
@@ -118,7 +118,7 @@ protected:
 public:
   void destroy(); // Must be called instead of the destructor
 
-  void latency_check(double latency);
+  void latency_check(double latency) const;
 
   /** @brief Public interface */
   const s4u::Link* get_iface() const { return &piface_; }