X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1677a24a253d883f3db0744651ea5cb489cbf73a..23a00833ef66ff4383394e3cac558a5232d4bd62:/src/simgrid/host.cpp diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 7f1a381ad9..002e68ca3f 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -16,7 +16,7 @@ size_t sg_host_count() const char *sg_host_get_name(sg_host_t host) { - return host->id().c_str(); + return host->getName().c_str(); } void* sg_host_extension_get(sg_host_t host, size_t ext) @@ -73,13 +73,12 @@ void sg_host_init() }); ROUTING_HOST_LEVEL = simgrid::Host::extension_create([](void *p) { - delete static_cast(p); + delete static_cast(p); }); SD_HOST_LEVEL = simgrid::Host::extension_create(__SD_workstation_destroy); SIMIX_HOST_LEVEL = simgrid::Host::extension_create(SIMIX_host_destroy); USER_HOST_LEVEL = simgrid::Host::extension_create(NULL); - simgrid::surf::Cpu::classInit(); } // ========== User data Layer ========== @@ -125,27 +124,6 @@ void sg_host_simix_destroy(sg_host_t host) { host->extension_set(SIMIX_HOST_LEVEL, nullptr); } -// ========== SURF CPU ============ -surf_cpu_t sg_host_surfcpu(sg_host_t host) { - return host->extension(); -} -void sg_host_surfcpu_set(sg_host_t host, surf_cpu_t cpu) { - host->extension_set(simgrid::surf::Cpu::EXTENSION_ID, cpu); // FIXME: use the typesafe version -} -void sg_host_surfcpu_destroy(sg_host_t host) { - host->extension_set(nullptr); -} -// ========== RoutingEdge ============ -surf_RoutingEdge *sg_host_edge(sg_host_t host) { - return (surf_RoutingEdge*) host->extension(ROUTING_HOST_LEVEL); -} -void sg_host_edge_set(sg_host_t host, surf_RoutingEdge *edge) { - host->extension_set(ROUTING_HOST_LEVEL, edge); -} -void sg_host_edge_destroy(sg_host_t host, int do_callback) { - host->extension_set(ROUTING_HOST_LEVEL, nullptr, do_callback); -} - // =========== user-level functions =============== // ================================================ double sg_host_get_speed(sg_host_t host){ @@ -193,7 +171,7 @@ int sg_host_get_pstate(sg_host_t host) { namespace simgrid { Host::Host(std::string const& id) - : id_(id) + : name_(id) { }