/** 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();
{
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));