Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move SimcallObserver from simgrid::mc to simgrid::kernel::actor
[simgrid.git] / include / simgrid / simix.hpp
index 3e9f2cd..2039dbf 100644 (file)
 #include <string>
 #include <unordered_map>
 
-XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code, simgrid::mc::SimcallObserver* observer);
-XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code, simgrid::mc::SimcallObserver* observer);
+XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code,
+                                   simgrid::kernel::actor::SimcallObserver* observer);
+XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code,
+                                     simgrid::kernel::actor::SimcallObserver* observer);
 
 namespace simgrid {
 namespace kernel {
@@ -43,7 +45,7 @@ namespace actor {
  * you may need to wait for that mutex to be unlocked by its current owner.
  * Potentially blocking simcall must be issued using simcall_blocking(), right below in this file.
  */
-template <class F> typename std::result_of_t<F()> simcall(F&& code, mc::SimcallObserver* observer = nullptr)
+template <class F> typename std::result_of_t<F()> simcall(F&& code, SimcallObserver* observer = nullptr)
 {
   // If we are in the maestro, we take the fast path and execute the
   // code directly without simcall marshalling/unmarshalling/dispatch:
@@ -75,7 +77,7 @@ template <class F> typename std::result_of_t<F()> simcall(F&& code, mc::SimcallO
  *
  * The return value is obtained from observer->get_result() if it exists. Otherwise void is returned.
  */
-template <class F> void simcall_blocking(F&& code, mc::SimcallObserver* observer = nullptr)
+template <class F> void simcall_blocking(F&& code, SimcallObserver* observer = nullptr)
 {
   xbt_assert(not SIMIX_is_maestro(), "Cannot execute blocking call in kernel mode");
 
@@ -89,7 +91,7 @@ template <class F> void simcall_blocking(F&& code, mc::SimcallObserver* observer
 template <class F, class Observer>
 auto simcall_blocking(F&& code, Observer* observer) -> decltype(observer->get_result())
 {
-  simcall_blocking(std::forward<F>(code), static_cast<mc::SimcallObserver*>(observer));
+  simcall_blocking(std::forward<F>(code), static_cast<SimcallObserver*>(observer));
   return observer->get_result();
 }
 } // namespace actor