Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cannot destroy iface before impl.
[simgrid.git] / src / plugins / vm / VirtualMachineImpl.hpp
index 2bddd02a10432e8e69cdcc1ffaaa392da27e6e44..031c355cfb9fe851dd763ef987911a4f35af7d5d 100644 (file)
@@ -38,15 +38,16 @@ public:
 
   static std::deque<s4u::VirtualMachine*> allVms_;
 
-  explicit VirtualMachineImpl(s4u::VirtualMachine* piface, s4u::Host* host, int core_amount, size_t ramsize);
+  explicit VirtualMachineImpl(const std::string& name, s4u::VirtualMachine* piface, s4u::Host* host, int core_amount,
+                              size_t ramsize);
   ~VirtualMachineImpl() override;
 
-  virtual void suspend(kernel::actor::ActorImpl* issuer);
-  virtual void resume();
-  virtual void shutdown(kernel::actor::ActorImpl* issuer);
+  void suspend(kernel::actor::ActorImpl* issuer);
+  void resume();
+  void shutdown(kernel::actor::ActorImpl* issuer);
 
   /** @brief Change the physical host on which the given VM is running */
-  virtual void set_physical_host(s4u::Host* dest);
+  void set_physical_host(s4u::Host* dest);
   /** @brief Get the physical host on which the given VM is running */
   s4u::Host* get_physical_host() const { return physical_host_; }
 
@@ -59,7 +60,10 @@ public:
   unsigned int get_core_amount() const { return core_amount_; }
   kernel::resource::Action* get_action() const { return action_; }
 
-  virtual void set_bound(double bound);
+  const s4u::VirtualMachine* get_iface() const override { return piface_; }
+  s4u::VirtualMachine* get_iface() override { return piface_; }
+
+  void set_bound(double bound);
 
   void update_action_weight();
 
@@ -71,6 +75,7 @@ public:
   bool is_migrating() const { return is_migrating_; }
 
 private:
+  s4u::VirtualMachine* piface_;
   kernel::resource::Action* action_ = nullptr;
   unsigned int active_execs_        = 0;
   s4u::Host* physical_host_;
@@ -100,7 +105,7 @@ public:
     return nullptr;
   };
 };
-}
-}
+} // namespace vm
+} // namespace simgrid
 
 #endif /* VM_INTERFACE_HPP_ */