Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Move other simcall to the Host class
[simgrid.git] / src / s4u / s4u_host.cpp
index b9d83b4..527dc29 100644 (file)
@@ -17,7 +17,8 @@ namespace s4u {
 boost::unordered_map<std::string, Host*> *Host::hosts
                = new boost::unordered_map<std::string, Host*>();
 
-Host::Host(const char*name) {
+Host::Host(const char*name)
+{
        p_inferior = sg_host_by_name(name);
        if (p_inferior==NULL)
                xbt_die("No such host: %s",name); //FIXME: raise an exception
@@ -52,10 +53,10 @@ const char* Host::name() {
 }
 
 void Host::turnOn() {
-       simcall_host_on(p_inferior);
+       p_inferior->on();
 }
 void Host::turnOff() {
-       simcall_host_off(p_inferior);
+       p_inferior->off();
 }
 bool Host::isOn() {
        return sg_host_get_state(p_inferior);
@@ -65,7 +66,7 @@ boost::unordered_map<std::string, Storage&> &Host::mountedStorages() {
        if (mounts == NULL) {
                mounts = new boost::unordered_map<std::string, Storage&> ();
 
-               xbt_dict_t dict = simcall_host_get_mounted_storage_list(p_inferior);
+               xbt_dict_t dict = p_inferior->getMountedStorageList();
 
                xbt_dict_cursor_t cursor;
                char *mountname;