- sg_platf_postparse_add_cb(SIMIX_post_create_environment);
- surf_on_host_created(SIMIX_host_create);
- surf_on_storage_created(SIMIX_storage_create_);
+ simgrid::surf::on_postparse.connect(SIMIX_post_create_environment);
+ simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
+ SIMIX_host_create(&host);
+ });
+ simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::Storage* storage) {
+ const char* id = storage->getName();
+ // TODO, create sg_storage_by_name
+ sg_storage_t s = xbt_lib_get_elm_or_null(storage_lib, id);
+ xbt_assert(s != NULL, "Storage not found for name %s", id);
+ SIMIX_storage_create_(s);
+ });
+