Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define const get_iface().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Oct 2020 19:12:14 +0000 (21:12 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Oct 2020 19:26:06 +0000 (21:26 +0200)
include/simgrid/kernel/routing/NetZoneImpl.hpp
src/kernel/activity/ConditionVariableImpl.hpp
src/kernel/resource/DiskImpl.hpp
src/plugins/link_energy_wifi.cpp
src/surf/HostImpl.hpp
src/surf/StorageImpl.hpp
src/surf/network_interface.hpp

index 8ac13ab..8ef575a 100644 (file)
@@ -103,6 +103,7 @@ public:
 
   resource::NetworkModel* network_model_;
 
+  const s4u::NetZone* get_iface() const { return &piface_; }
   s4u::NetZone* get_iface() { return &piface_; }
   unsigned int get_table_size() const { return vertices_.size(); }
   std::vector<kernel::routing::NetPoint*> get_vertices() const { return vertices_; }
index eb6937b..b410565 100644 (file)
@@ -28,6 +28,7 @@ public:
   ~ConditionVariableImpl() = default;
 
   void remove_sleeping_actor(actor::ActorImpl& actor) { xbt::intrusive_erase(sleeping_, actor); }
+  const s4u::ConditionVariable* get_iface() const { return &piface_; }
   s4u::ConditionVariable* get_iface() { return &piface_; }
   void broadcast();
   void signal();
index 29841c2..9671f44 100644 (file)
@@ -64,6 +64,7 @@ public:
   ~DiskImpl() override;
 
   /** @brief Public interface */
+  const s4u::Disk* get_iface() const { return &piface_; }
   s4u::Disk* get_iface() { return &piface_; }
   s4u::Host* get_host() const { return host_; }
   void set_host(s4u::Host* host) { host_ = host; }
index 9a50b2e..a422f97 100644 (file)
@@ -337,8 +337,8 @@ void sg_wifi_energy_plugin_init()
     if (actionWifi == nullptr)
       return;
 
-    auto link_src  = actionWifi->get_src_link();
-    auto link_dst = actionWifi->get_dst_link();
+    auto const* link_src = actionWifi->get_src_link();
+    auto const* link_dst = actionWifi->get_dst_link();
 
     if(link_src != nullptr)
       link_src->get_iface()->extension<LinkEnergyWifi>()->update(action);
index 6e3404f..f75b5c6 100644 (file)
@@ -63,7 +63,7 @@ public:
   std::unordered_map<std::string, s4u::Storage*>* get_mounted_storages();
   void set_storages(const std::map<std::string, kernel::resource::StorageImpl*>& storages) { storage_ = storages; }
 
-  s4u::Host* get_iface() { return piface_; }
+  s4u::Host* get_iface() const { return piface_; }
 
   void turn_on() const;
   void turn_off(const kernel::actor::ActorImpl* issuer);
index 72e3092..6f98702 100644 (file)
@@ -82,6 +82,7 @@ public:
 
   ~StorageImpl() override;
 
+  const s4u::Storage* get_iface() const { return &piface_; }
   s4u::Storage* get_iface() { return &piface_; }
   const char* get_type() const { return typeId_.c_str(); }
   lmm::Constraint* get_read_constraint() const { return constraint_read_; }
index 9cb6cc7..6646f8f 100644 (file)
@@ -121,6 +121,7 @@ public:
   void destroy(); // Must be called instead of the destructor
 
   /** @brief Public interface */
+  const s4u::Link* get_iface() const { return &piface_; }
   s4u::Link* get_iface() { return &piface_; }
 
   /** @brief Get the bandwidth in bytes per second of current Link */