Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New function xbt_replay_action_get(): Retrieve the function previously associated...
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 24 Apr 2017 12:46:28 +0000 (14:46 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 24 Apr 2017 12:46:28 +0000 (14:46 +0200)
ChangeLog
include/xbt/replay.hpp
src/xbt/xbt_replay.cpp

index 8cd98ce..0f6fda8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,10 @@ SimDag
 SMPI
  - New algorithm to privatize globals: dlopen, with dynamic loading tricks
 
 SMPI
  - New algorithm to privatize globals: dlopen, with dynamic loading tricks
 
+ XBT/Replay:
+  - New function xbt_replay_action_get():
+    Retrieve the function previously associated to an event type.
+
  -- Release target: June 21 2017   -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.15) stable; urgency=low
  -- Release target: June 21 2017   -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
 
 SimGrid (3.15) stable; urgency=low
index be41b1c..b20852b 100644 (file)
@@ -31,6 +31,7 @@ SG_BEGIN_DECL()
 
 typedef void (*action_fun)(const char* const* args);
 XBT_PUBLIC(void) xbt_replay_action_register(const char* action_name, action_fun function);
 
 typedef void (*action_fun)(const char* const* args);
 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);
 
 SG_END_DECL()
 
 
 SG_END_DECL()
 
index 4e9f9fc..408c7f4 100644 (file)
@@ -180,3 +180,14 @@ void xbt_replay_action_register(const char* action_name, action_fun function)
 {
   simgrid::xbt::action_funs.insert({std::string(action_name), function});
 }
 {
   simgrid::xbt::action_funs.insert({std::string(action_name), function});
 }
+
+/**
+ * \ingroup XBT_replay
+ * \brief Get the function that was previously registered to handle a kind of action
+ *
+ * This can be useful if you want to override and extend an existing action.
+ */
+action_fun xbt_replay_action_get(const char* action_name)
+{
+  return simgrid::xbt::action_funs.at(std::string(action_name));
+}