From c30f84c066cb39165fd9f6a5e56fb37b9bffca35 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 1 Dec 2016 21:09:29 +0100 Subject: [PATCH] add an EngineImpl, unused so far --- include/simgrid/s4u/engine.hpp | 5 +++++ src/kernel/EngineImpl.cpp | 21 +++++++++++++++++++++ src/kernel/EngineImpl.hpp | 25 +++++++++++++++++++++++++ src/s4u/s4u_engine.cpp | 4 ++++ tools/cmake/DefinePackages.cmake | 7 +++++-- 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/kernel/EngineImpl.cpp create mode 100644 src/kernel/EngineImpl.hpp diff --git a/include/simgrid/s4u/engine.hpp b/include/simgrid/s4u/engine.hpp index dc982073d1..395ea59060 100644 --- a/include/simgrid/s4u/engine.hpp +++ b/include/simgrid/s4u/engine.hpp @@ -18,6 +18,9 @@ #include 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 index 0000000000..552b4b0de6 --- /dev/null +++ b/src/kernel/EngineImpl.cpp @@ -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 + +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 index 0000000000..750cb62b99 --- /dev/null +++ b/src/kernel/EngineImpl.hpp @@ -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 +#include + +namespace simgrid { +namespace kernel { +namespace routing { +class AsImpl; +} + +class EngineImpl { +public: + EngineImpl(); + virtual ~EngineImpl(); + kernel::routing::AsImpl* rootAs_ = nullptr; + +protected: + friend simgrid::s4u::Engine; +}; +} +} diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 4f3b10602a..ad67fbd6fb 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -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) diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index f7324634b0..1deef26e76 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -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 -- 2.20.1