From: Martin Quinson Date: Wed, 6 Jan 2016 20:45:13 +0000 (+0100) Subject: remove a C-like pimple X-Git-Tag: v3_13~1330 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/71c619779ed661b50ce589403a0f4df7ab0865de remove a C-like pimple --- diff --git a/src/surf/host_interface.cpp b/src/surf/host_interface.cpp index 203bedeea4..8772f95300 100644 --- a/src/surf/host_interface.cpp +++ b/src/surf/host_interface.cpp @@ -31,7 +31,10 @@ void host_add_traces(){ namespace simgrid { namespace surf { -simgrid::xbt::Extension Host::EXTENSION_ID; +simgrid::xbt::Extension Host::EXTENSION_ID = + simgrid::Host::extension_create([](void *h) { + static_cast(h)->destroy(); + }); /********* * Model * @@ -87,15 +90,6 @@ simgrid::surf::signal Host::onCreation; simgrid::surf::signal Host::onDestruction; simgrid::surf::signal Host::onStateChange; -void Host::classInit() -{ - if (!EXTENSION_ID.valid()) { - EXTENSION_ID = simgrid::Host::extension_create([](void *h) { - static_cast(h)->destroy(); - }); - } -} - Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, xbt_dynar_t storage, NetCard *netElm, Cpu *cpu) : Resource(model, name) diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 3177e18ca2..b69e1a8e12 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -84,7 +84,6 @@ public: static simgrid::surf::signal onStateChange; public: - static void classInit(); // must be called before the first use of that class /** * @brief Host constructor * diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index fe54219dcf..b05dfd7a45 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -316,7 +316,6 @@ void surf_init(int *argc, char **argv) ROUTING_PROP_ASR_LEVEL = xbt_lib_add_level(as_router_lib,routing_asr_prop_free); XBT_DEBUG("Add SURF levels"); - simgrid::surf::Host::classInit(); SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free); xbt_init(argc, argv);