Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Continue to migrate contents of simix_global to EngineImpl
[simgrid.git] / src / simix / smx_private.hpp
index abea06b..054f2ec 100644 (file)
@@ -1,50 +1,32 @@
-/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2021. 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_SIMIX_PRIVATE_HPP
-#define SIMGRID_SIMIX_PRIVATE_HPP
+#ifndef SIMIX_PRIVATE_HPP
+#define SIMIX_PRIVATE_HPP
 
-#include <simgrid/simix.hpp>
-#include "smx_private.h"
-#include "src/simix/popping_private.h"
+#include "simgrid/s4u/Actor.hpp"
+#include "src/kernel/actor/ActorImpl.hpp"
+#include "src/kernel/context/Context.hpp"
 
-/** @brief Executes all the processes to run (in parallel if possible). */
-static inline void SIMIX_context_runall(void)
-{
-  if (!xbt_dynar_is_empty(simix_global->process_to_run))
-    simix_global->context_factory->run_all();
-}
-
-/** @brief returns the current running context */
-static inline smx_context_t SIMIX_context_self(void)
-{
-  if (simix_global && simix_global->context_factory)
-    return simix_global->context_factory->self();
-  else
-    return nullptr;
-}
+/********************************** Simix Global ******************************/
 
 namespace simgrid {
 namespace simix {
 
-XBT_PRIVATE ContextFactory* thread_factory();
-XBT_PRIVATE ContextFactory* sysv_factory();
-XBT_PRIVATE ContextFactory* raw_factory();
-XBT_PRIVATE ContextFactory* boost_factory();
-
-template<class R, class... Args> inline
-R simcall(e_smx_simcall_t call, Args&&... args)
-{
-  smx_process_t self = SIMIX_process_self();
-  marshal(&self->simcall, call, std::forward<Args>(args)...);
-  simcall_call(self);
-  return unmarshal<R>(self->simcall.result);
-}
+class Global {
+public:
 
+  kernel::context::ContextFactory* context_factory = nullptr;
+  kernel::actor::ActorImpl* maestro_ = nullptr;
+
+};
 }
 }
 
+XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
+
+XBT_PUBLIC void SIMIX_clean();
+
 #endif