Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add Host::by_name(char*)
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 14 Dec 2017 13:58:12 +0000 (14:58 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 14 Dec 2017 16:41:58 +0000 (17:41 +0100)
include/simgrid/s4u/Host.hpp
src/s4u/s4u_host.cpp

index 889419c..a959c5c 100644 (file)
@@ -61,6 +61,8 @@ public:
   /** Retrieves an host from its name, or return nullptr */
   static Host* by_name_or_null(std::string name);
   /** Retrieves an host from its name, or die */
+  static s4u::Host* by_name(const char* name);
+  /** Retrieves an host from its name, or die */
   static s4u::Host* by_name(std::string name);
   /** Retrieves the host on which the current actor is running */
   static s4u::Host* current();
index 9b4f49a..82d6d66 100644 (file)
@@ -81,6 +81,10 @@ Host* Host::by_name(std::string name)
 {
   return host_list.at(name); // Will raise a std::out_of_range if the host does not exist
 }
+Host* Host::by_name(const char* name)
+{
+  return host_list.at(std::string(name)); // Will raise a std::out_of_range if the host does not exist
+}
 Host* Host::by_name_or_null(const char* name)
 {
   return by_name_or_null(std::string(name));