Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
const++
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 9 Jul 2020 10:03:22 +0000 (12:03 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 9 Jul 2020 10:03:22 +0000 (12:03 +0200)
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Link.hpp
src/s4u/s4u_Link.cpp
teshsuite/surf/wifi_usage/wifi_usage.cpp

index 4a8789a..60bc502 100644 (file)
@@ -98,7 +98,7 @@ public:
   /** Unblock the progression of this activity if it was suspended previously */
   virtual Activity* resume();
   /** Whether or not the progression of this activity is blocked */
-  bool is_suspended() { return suspended_; }
+  bool is_suspended() const { return suspended_; }
 
   virtual const char* get_cname() const       = 0;
   virtual const std::string& get_name() const = 0;
index 552d57a..6dbf49e 100644 (file)
@@ -74,7 +74,7 @@ public:
    * location of hosts into account, or even to model mobility in your SimGrid simulation.
    *
    * Note that this function asserts that the link is actually a wifi link */
-  void set_host_wifi_rate(s4u::Host* host, int level);
+  void set_host_wifi_rate(const s4u::Host* host, int level) const;
 
   /** @brief Returns the current load (in bytes per second) */
   double get_usage() const;
index 1b9dfd7..3ac5de9 100644 (file)
@@ -76,7 +76,7 @@ Link::SharingPolicy Link::get_sharing_policy() const
   return this->pimpl_->get_sharing_policy();
 }
 
-void Link::set_host_wifi_rate(s4u::Host* host, int level)
+void Link::set_host_wifi_rate(const s4u::Host* host, int level) const
 {
   xbt_assert(pimpl_->get_sharing_policy() == Link::SharingPolicy::WIFI, "Link %s does not seem to be a wifi link.",
              get_cname());
index 6265626..19e1741 100644 (file)
@@ -72,7 +72,7 @@ void run_ping_test(const char* src, const char* dest, int data_size)
              simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
   });
   simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
-  auto* ap1 = simgrid::s4u::Link::by_name("AP1");
+  const auto* ap1 = simgrid::s4u::Link::by_name("AP1");
   ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(src), 0);
   ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(dest), 0);
   simgrid::s4u::this_actor::sleep_for(10);