Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add an EngineImpl, unused so far
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 1 Dec 2016 20:09:29 +0000 (21:09 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 1 Dec 2016 20:19:15 +0000 (21:19 +0100)
include/simgrid/s4u/engine.hpp
src/kernel/EngineImpl.cpp [new file with mode: 0644]
src/kernel/EngineImpl.hpp [new file with mode: 0644]
src/s4u/s4u_engine.cpp
tools/cmake/DefinePackages.cmake

index dc98207..395ea59 100644 (file)
@@ -18,6 +18,9 @@
 #include <simgrid/s4u/forward.hpp>
 
 namespace simgrid {
+namespace kernel {
+class EngineImpl;
+}
 namespace s4u {
 /** @brief Simulation engine
  *
@@ -86,6 +89,8 @@ public:
     });
   }
 
+  simgrid::kernel::EngineImpl* pimpl;
+
 private:
   static s4u::Engine *instance_;
 };
diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp
new file mode 100644 (file)
index 0000000..552b4b0
--- /dev/null
@@ -0,0 +1,21 @@
+/* Copyright (c) 2016. 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 "src/kernel/EngineImpl.hpp"
+#include "src/kernel/routing/AsImpl.hpp"
+#include <simgrid/s4u/host.hpp>
+
+namespace simgrid {
+namespace kernel {
+
+EngineImpl::EngineImpl()
+{
+}
+EngineImpl::~EngineImpl()
+{
+  delete rootAs_;
+}
+}
+}
diff --git a/src/kernel/EngineImpl.hpp b/src/kernel/EngineImpl.hpp
new file mode 100644 (file)
index 0000000..750cb62
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright (c) 2016. 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 <simgrid/s4u/forward.hpp>
+#include <xbt/dict.h>
+
+namespace simgrid {
+namespace kernel {
+namespace routing {
+class AsImpl;
+}
+
+class EngineImpl {
+public:
+  EngineImpl();
+  virtual ~EngineImpl();
+  kernel::routing::AsImpl* rootAs_ = nullptr;
+
+protected:
+  friend simgrid::s4u::Engine;
+};
+}
+}
index 4f3b106..ad67fbd 100644 (file)
@@ -12,6 +12,8 @@
 #include "simgrid/s4u/engine.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 #include "simgrid/s4u/storage.hpp"
+#include "simgrid/simix.h"
+#include "src/kernel/EngineImpl.hpp"
 
 #include "surf/surf.h"               // routing_platf. FIXME:KILLME. SOON
 #include "src/surf/surf_routing.hpp" // routing_platf. FIXME:KILLME. SOON
@@ -27,6 +29,7 @@ Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see
 Engine::Engine(int *argc, char **argv) {
   xbt_assert(s4u::Engine::instance_ == nullptr, "It is currently forbidden to create more than one instance of s4u::Engine");
   s4u::Engine::instance_ = this;
+  // pimpl                  = new kernel::EngineImpl();
 
   TRACE_global_init(argc, argv);
   SIMIX_global_init(argc, argv);
@@ -78,6 +81,7 @@ void Engine::run() {
 s4u::As *Engine::rootAs()
 {
   return routing_platf->root_; // FIXME: get the root into the Engine directly (and kill the platf)
+  // return pimpl->rootAs_;
 }
 
 static s4u::As *asByNameRecursive(s4u::As *current, const char *name)
index f732463..1deef26 100644 (file)
@@ -73,7 +73,7 @@ set(EXTRA_DIST
   src/kernel/routing/AsFull.hpp
   src/kernel/routing/AsRoutedGraph.hpp
   src/kernel/routing/AsNone.hpp
-  src/kernel/routing/AsVivaldi.hpp
+  src/kernel/routing/AsVivaldi.hpp  
 
   src/surf/storage_interface.hpp
   src/surf/storage_n11.hpp
@@ -305,7 +305,10 @@ set(SURF_SRC
   src/kernel/routing/AsRoutedGraph.cpp
   src/kernel/routing/AsNone.cpp
   src/kernel/routing/AsVivaldi.cpp
-  
+
+  src/kernel/EngineImpl.cpp
+  src/kernel/EngineImpl.hpp
+
   src/surf/cpu_cas01.cpp
   src/surf/cpu_interface.cpp
   src/surf/cpu_ti.cpp