Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branches 'master' and 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / include / simgrid / s4u / host.hpp
index 4e59267..b197b72 100644 (file)
@@ -44,7 +44,18 @@ XBT_PUBLIC_CLASS Host :
 
 public:
   explicit Host(const char *name);
-  ~Host(); // TODO, make me private
+
+  /** Host destruction logic */
+protected:
+  virtual ~Host();
+
+private:
+  bool currentlyDestroying_ = false;
+public:
+  void destroy();
+  // No copy/move
+  Host(Host const&) = delete;
+  Host& operator=(Host const&) = delete;
 
   /** Retrieves an host from its name, or return nullptr */
   static Host* by_name_or_null(const char* name);
@@ -65,6 +76,7 @@ public:
   void turnOff();
   /** Returns if that host is currently up and running */
   bool isOn();
+  /** Returns if that host is currently down and offline */
   bool isOff() { return !isOn(); }
 
   double speed();
@@ -78,8 +90,8 @@ public:
   int pstatesCount() const;
   void setPstate(int pstate_index);
   int pstate();
-  void parameters(vm_params_t params);
-  void setParameters(vm_params_t params);
+  virtual void parameters(vm_params_t params);
+  virtual void setParameters(vm_params_t params);
   xbt_dict_t mountedStoragesAsDict(); // HACK
   xbt_dynar_t attachedStorages();
 
@@ -95,6 +107,7 @@ private:
 
 public:
   // TODO, this could be a unique_ptr
+  surf::HostImpl* pimpl_ = nullptr;
   /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
   surf::Cpu     *pimpl_cpu = nullptr;
   /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */