Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove surf_host_* functions
[simgrid.git] / src / surf / virtual_machine.hpp
index baef9f2..c28b44d 100644 (file)
@@ -62,14 +62,12 @@ public:
    * @param netElm The RoutingEdge associated to this VM
    * @param cpu The Cpu associated to this VM
    */
-  VirtualMachine(simgrid::surf::Model *model, const char *name, xbt_dict_t props,
+  VirtualMachine(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props,
                        simgrid::Host *host);
 
   /** @brief Destructor */
   ~VirtualMachine();
 
-  void setState(e_surf_resource_state_t state);
-
   /** @brief Suspend the VM */
   virtual void suspend()=0;
 
@@ -94,7 +92,17 @@ public:
   /* The vm object of the lower layer */
   CpuAction *p_action;
   simgrid::Host *p_hostPM;
-  e_surf_vm_state_t p_currentState;
+
+  void turnOn() override;
+  void turnOff() override;
+
+public:
+  e_surf_vm_state_t getState();
+  void setState(e_surf_vm_state_t state);
+protected:
+  e_surf_vm_state_t p_vm_state = SURF_VM_STATE_CREATED;
+
+
 public:
   boost::intrusive::list_member_hook<> vm_hook;
 };
@@ -111,8 +119,6 @@ public:
   VMModel() :HostModel(){}
   ~VMModel(){};
 
-  Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu,xbt_dict_t props) override {DIE_IMPOSSIBLE;}
-
   /**
    * @brief Create a new VM
    *