Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
not all resources need a property set, only Host, Link and Storage
[simgrid.git] / src / surf / host_interface.hpp
index 915c14a..090c2ed 100644 (file)
@@ -74,7 +74,7 @@ public:
   HostModel() : Model() {}
   ~HostModel() {}
 
-  virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu)=0;
+  virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu, xbt_dict_t props)=0;
   void addTraces(){DIE_IMPOSSIBLE;}
 
   virtual void adjustWeightOfDummyCpuActions();
@@ -129,6 +129,7 @@ public:
   /** @brief Host destructor */
   ~Host();
 
+  void attach(simgrid::Host* host);
   void setState(e_surf_resource_state_t state);
 
   /**
@@ -267,6 +268,8 @@ public:
   xbt_dynar_t p_storage;
   RoutingEdge *p_netElm;
   Cpu *p_cpu;
+  simgrid::Host* p_host = nullptr;
+  xbt_dict_t p_properties = NULL;
 
   /** @brief Get the list of virtual machines on the current Host */
   xbt_dynar_t getVms();
@@ -277,6 +280,7 @@ public:
   void getParams(vm_params_t params);
   /** @brief Sets the params of that VM/PM */
   void setParams(vm_params_t params);
+  simgrid::Host* getHost() { return p_host; }
 private:
   s_vm_params_t p_params;
 };