Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill two almost empty files by inlining the contained function
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 24 Feb 2016 21:23:51 +0000 (22:23 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 24 Feb 2016 21:23:51 +0000 (22:23 +0100)
src/msg/msg_global.cpp
src/simix/smx_global.cpp
src/surf/callbacks.cpp [deleted file]
src/surf/callbacks.h [deleted file]
tools/cmake/DefinePackages.cmake

index 4d5d20d..b3e1877 100644 (file)
@@ -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");
index ac04a45..23c9120 100644 (file)
@@ -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 (file)
index 2ba7865..0000000
+++ /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 <xbt/asserts.h>
-
-#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 (file)
index 4713790..0000000
+++ /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 <xbt/base.h>
-#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
index 10a5d60..3b714de 100644 (file)
@@ -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