Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Give a p_netcard to simgrid::Host instead of relying on extensions for that
[simgrid.git] / include / simgrid / Host.hpp
index a4e8ec5..2810c16 100644 (file)
@@ -7,24 +7,32 @@
 #ifndef SIMGRID_HOST_HPP
 #define SIMGRID_HOST_HPP
 
+#include <cstddef>
 #include <memory>
 #include <string>
 #include <vector>
 
 #include <xbt/base.h>
-#include <xbt/Lib.hpp>
+#include <xbt/string.hpp>
+#include <xbt/Extendable.hpp>
 
 namespace simgrid {
 
-XBT_PUBLIC_CLASS Host : public simgrid::xbt::Lib<Host> {
+XBT_PUBLIC_CLASS Host :
+public simgrid::xbt::Extendable<Host> {
+
+public:
+         surf::Cpu     *p_cpu = nullptr;
+         surf::NetCard *p_netcard = nullptr;
+
 private:
-  std::string id_;
+  simgrid::xbt::string name_ = "noname";
 public:
-  Host(std::string id);
+  Host(std::string const& name);
   ~Host();
-  std::string const& id() const { return id_; }
-  static Host* find_host(const char* name);
-  static Host* get_host(const char* name);
+  simgrid::xbt::string const& getName() const { return name_; }
+  static Host* by_name_or_null(const char* name);
+  static Host* by_name_or_create(const char* name);
 };
 
 }