Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups: there is no random in the platforms since a while
[simgrid.git] / src / simix / smx_private.hpp
index a6051cc..255105f 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <simgrid/simix.hpp>
 #include "smx_private.h"
+#include "src/simix/popping_private.h"
 
 /**
  * \brief destroy a context
@@ -77,6 +78,15 @@ 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);
+}
+
 }
 }