Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] simgrid::surf::Host, add backlink and attach() method
[simgrid.git] / src / surf / surf_c_bindings.cpp
index fb4004a..740ed9d 100644 (file)
@@ -171,7 +171,7 @@ void routing_get_route_and_latency(sg_routing_edge_t src, sg_routing_edge_t dst,
 surf_host_model_t surf_host_get_model(sg_host_t host)
 {
   simgrid::surf::Host* surf_host =
-    (simgrid::surf::Host*) host->facet(SURF_HOST_LEVEL);
+    (simgrid::surf::Host*) host->facet<simgrid::surf::Host>();
   return (surf_host_model_t) surf_host->getModel();
 }
 
@@ -396,7 +396,7 @@ void surf_vm_destroy(sg_host_t resource){
   sg_host_surfcpu_destroy(resource);
   sg_host_edge_destroy(resource,1);
   // TODO, use backlink from simgrid::surf::Host to simgrid::Host
-  simgrid::Host::by_name_or_null(name)->set_facet(SURF_HOST_LEVEL, nullptr);
+  simgrid::Host::by_name_or_null(name)->set_facet((simgrid::surf::Host*)nullptr);
 
   /* TODO: comment out when VM storage is implemented. */
   // host->set_facet(SURF_STORAGE_LEVEL, nullptr);