action_fun previous_send;
static void overriding_send(simgrid::xbt::ReplayAction& args)
{
- (*previous_send)(args); // Just call the overriden symbol. That's a toy example.
+ previous_send(args); // Just call the overriden symbol. That's a toy example.
}
int main(int argc, char* argv[])
#include <xbt/misc.h> /* SG_BEGIN_DECL */
#include <fstream>
+#include <functional>
#include <queue>
#include <unordered_map>
}
}
-typedef void (*action_fun)(simgrid::xbt::ReplayAction&);
+typedef std::function<void(simgrid::xbt::ReplayAction&)> action_fun;
XBT_PUBLIC void xbt_replay_action_register(const char* action_name, action_fun function);
XBT_PUBLIC action_fun xbt_replay_action_get(const char* action_name);