From 75d21dd1f2f7886396927dab248d27886f35bf37 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 24 Feb 2016 22:23:51 +0100 Subject: [PATCH] kill two almost empty files by inlining the contained function --- src/msg/msg_global.cpp | 1 - src/simix/smx_global.cpp | 12 +++++++++--- src/surf/callbacks.cpp | 23 ----------------------- src/surf/callbacks.h | 25 ------------------------- tools/cmake/DefinePackages.cmake | 2 -- 5 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 src/surf/callbacks.cpp delete mode 100644 src/surf/callbacks.h diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index 4d5d20d21e..b3e1877ee5 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -15,7 +15,6 @@ #include "xbt/ex.h" /* ex_backtrace_display */ #include "xbt/replay.h" #include "simgrid/sg_config.h" /* Configuration mechanism of SimGrid */ -#include "src/surf/callbacks.h" #include "src/surf/xml/platf_private.hpp" // FIXME: KILLME by removing MSG_post_create_environment() XBT_LOG_NEW_CATEGORY(msg, "All MSG categories"); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index ac04a45f6c..23c9120681 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -12,6 +12,7 @@ #endif #include "src/surf/surf_interface.hpp" +#include "src/surf/storage_interface.hpp" #include "src/surf/xml/platf.hpp" #include "smx_private.h" #include "smx_private.hpp" @@ -24,8 +25,6 @@ #include "src/mc/mc_replay.h" #include "simgrid/sg_config.h" -#include "src/surf/callbacks.h" - #ifdef HAVE_MC #include "src/mc/mc_private.h" #include "src/mc/mc_protocol.h" @@ -259,7 +258,14 @@ void SIMIX_global_init(int *argc, char **argv) simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) { SIMIX_host_create(&host); }); - surf_on_storage_created(SIMIX_storage_create_); + 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); + }); + } if (!simix_timers) { diff --git a/src/surf/callbacks.cpp b/src/surf/callbacks.cpp deleted file mode 100644 index 2ba786589c..0000000000 --- a/src/surf/callbacks.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2015. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#include - -#include "src/surf/callbacks.h" - -#include "src/surf/HostImplem.hpp" -#include "src/surf/surf_interface.hpp" - -void surf_on_storage_created(void (*callback)(sg_storage_t)) -{ - simgrid::surf::storageCreatedCallbacks.connect([callback](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); - callback(s); - }); -} diff --git a/src/surf/callbacks.h b/src/surf/callbacks.h deleted file mode 100644 index 4713790bf3..0000000000 --- a/src/surf/callbacks.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2015. The SimGrid Team. - * All rights reserved. */ - -/* This program is free software; you can redistribute it and/or modify it - * under the terms of the license (GNU LGPL) which comes with this package. */ - -#ifndef SIMGRID_SURF_CALLBACKS_H -#define SIMGRID_SURF_CALLBACKS_H - -/** \file callbacks.h - * - * C interface for the C++ SURF callbacks. - */ - -#include -#include "simgrid/host.h" -#include "simgrid/msg.h" - -SG_BEGIN_DECL(); - -XBT_PRIVATE void surf_on_storage_created(void (*callback)(sg_storage_t)); - -SG_END_DECL(); - -#endif diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 10a5d604b7..3b714dedb1 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -298,8 +298,6 @@ set(NS3_SRC ) set(SURF_SRC - src/surf/callbacks.h - src/surf/callbacks.cpp src/surf/cpu_cas01.cpp src/surf/cpu_interface.cpp src/surf/cpu_ti.cpp -- 2.20.1