X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3e0c19b51995dedb551e2f7f7af05e2f20f29845..efd5719fdcd06a99d1fd644b81c7e9d578c08fc5:/src/surf/host_interface.cpp diff --git a/src/surf/host_interface.cpp b/src/surf/host_interface.cpp index bc4e28650b..ae57db2e00 100644 --- a/src/surf/host_interface.cpp +++ b/src/surf/host_interface.cpp @@ -31,10 +31,7 @@ void host_add_traces(){ namespace simgrid { namespace surf { -simgrid::xbt::Extension Host::EXTENSION_ID = - simgrid::Host::extension_create([](void *h) { - static_cast(h)->destroy(); - }); +simgrid::xbt::Extension Host::EXTENSION_ID; /********* * Model * @@ -85,11 +82,20 @@ void HostModel::adjustWeightOfDummyCpuActions() /************ * Resource * ************/ -simgrid::surf::signal Host::onCreation; -simgrid::surf::signal Host::onDestruction; -simgrid::surf::signal Host::onStateChange; +simgrid::xbt::signal Host::onCreation; +simgrid::xbt::signal Host::onDestruction; +simgrid::xbt::signal Host::onStateChange; -Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, +void Host::classInit() +{ + if (!EXTENSION_ID.valid()) { + EXTENSION_ID = simgrid::Host::extension_create([](void *h) { + static_cast(h)->destroy(); + }); + } +} + +Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, xbt_dynar_t storage, Cpu *cpu) : Resource(model, name) , PropertyHolder(props) @@ -98,7 +104,7 @@ Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, p_params.ramsize = 0; } -Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, +Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, xbt_dynar_t storage, Cpu *cpu) : Resource(model, name, constraint) , PropertyHolder(props)