Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Const get_bandwidth() and get_latency().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Oct 2020 20:06:54 +0000 (22:06 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Oct 2020 21:10:32 +0000 (23:10 +0200)
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp

index 949e071..8084ae5 100644 (file)
@@ -109,12 +109,12 @@ bool LinkImpl::is_used() const
   return get_model()->get_maxmin_system()->constraint_used(get_constraint());
 }
 
-double LinkImpl::get_latency()
+double LinkImpl::get_latency() const
 {
   return latency_.peak * latency_.scale;
 }
 
-double LinkImpl::get_bandwidth()
+double LinkImpl::get_bandwidth() const
 {
   return bandwidth_.peak * bandwidth_.scale;
 }
index d68e492..89b1e53 100644 (file)
@@ -125,13 +125,13 @@ public:
   s4u::Link* get_iface() { return &piface_; }
 
   /** @brief Get the bandwidth in bytes per second of current Link */
-  virtual double get_bandwidth();
+  virtual double get_bandwidth() const;
 
   /** @brief Update the bandwidth in bytes per second of current Link */
   virtual void set_bandwidth(double value) = 0;
 
   /** @brief Get the latency in seconds of current Link */
-  virtual double get_latency();
+  virtual double get_latency() const;
 
   /** @brief Update the latency in seconds of current Link */
   virtual void set_latency(double value) = 0;
index ace2e77..e02b595 100644 (file)
@@ -175,7 +175,7 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
                              std::vector<simgrid::kernel::resource::LinkImpl*> const& link_list)
 {
   if (link_list.size() == 1) {
-    auto* link = static_cast<simgrid::kernel::resource::LinkNS3*>(link_list[0]);
+    auto const* link = static_cast<simgrid::kernel::resource::LinkNS3*>(link_list[0]);
 
     XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s %s", src->get_cname(), dst->get_cname(), link->get_cname(),
               (link->get_sharing_policy() == simgrid::s4u::Link::SharingPolicy::WIFI ? "(wifi)" : "(wired)"),