Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change StateChanged callback signatures
authorPaul Bédaride <paul.bedaride@gmail.com>
Tue, 25 Mar 2014 09:42:44 +0000 (10:42 +0100)
committerPaul Bédaride <paul.bedaride@gmail.com>
Wed, 26 Mar 2014 16:03:48 +0000 (17:03 +0100)
15 files changed:
buildtools/Cmake/DefinePackages.cmake
examples/java/reservationSurfPlugin/ReservationPlugin.java
examples/java/surfPlugin/TracePlugin.java
src/bindings/java/surf.i
src/bindings/java/surf_swig.cpp
src/bindings/java/surf_swig.hpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/plugins/energy.cpp
src/surf/storage_interface.cpp
src/surf/storage_interface.hpp
src/surf/workstation_interface.cpp
src/surf/workstation_interface.hpp

index 2c0e140..d7b0a5a 100644 (file)
@@ -505,6 +505,9 @@ set(JSURF_JAVA_GENERATED_SRC
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkLink.java
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkAction.java
 
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkLink.java
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/NetworkAction.java
 
+  ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ActionState.java
+  ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/ResourceState.java
+
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmConstraint.java
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/XbtDict.java
 )
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/LmmConstraint.java
   ${CMAKE_BINARY_DIR}/src/bindings/java/org/simgrid/surf/XbtDict.java
 )
index 0bd91aa..8a637a8 100644 (file)
@@ -34,11 +34,11 @@ public class ReservationPlugin extends Plugin {
     Msg.info("Trace: Cpu destructed "+cpu.getName());
   }
 
     Msg.info("Trace: Cpu destructed "+cpu.getName());
   }
 
-  public void cpuStateChangedCallback(Cpu cpu){
+  public void cpuStateChangedCallback(Cpu cpu, ResourceState old, ResourceState cur){
     Msg.info("Trace: Cpu state changed "+cpu.getName());
   }
 
     Msg.info("Trace: Cpu state changed "+cpu.getName());
   }
 
-  public void cpuActionStateChangedCallback(CpuAction action){
+  public void cpuActionStateChangedCallback(CpuAction action, ActionState old, ActionState cur){
     Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
   }
 
     Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
   }
 
@@ -50,11 +50,11 @@ public class ReservationPlugin extends Plugin {
     Msg.info("Trace: NetworkLink destructed "+link.getName());
   }
 
     Msg.info("Trace: NetworkLink destructed "+link.getName());
   }
 
-  public void networkLinkStateChangedCallback(NetworkLink link){
+  public void networkLinkStateChangedCallback(NetworkLink link, ResourceState old, ResourceState cur){
     Msg.info("Trace: NetworkLink state changed "+link.getName());
   }
 
     Msg.info("Trace: NetworkLink state changed "+link.getName());
   }
 
-  public void networkActionStateChangedCallback(NetworkAction action){
+  public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur){
     Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
   }
 
     Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
   }
 
index 6de1823..0d1fec4 100644 (file)
@@ -26,11 +26,11 @@ public class TracePlugin extends Plugin {
     Msg.info("Trace: Cpu destructed "+cpu.getName());
   }
 
     Msg.info("Trace: Cpu destructed "+cpu.getName());
   }
 
-  public void cpuStateChangedCallback(Cpu cpu){
+  public void cpuStateChangedCallback(Cpu cpu, ResourceState old, ResourceState cur){
     Msg.info("Trace: Cpu state changed "+cpu.getName());
   }
 
     Msg.info("Trace: Cpu state changed "+cpu.getName());
   }
 
-  public void cpuActionStateChangedCallback(CpuAction action){
+  public void cpuActionStateChangedCallback(CpuAction action, ActionState old, ActionState cur){
     Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
   }
 
     Msg.info("Trace: CpuAction state changed "+action.getModel().getName());
   }
 
@@ -42,11 +42,11 @@ public class TracePlugin extends Plugin {
     Msg.info("Trace: NetworkLink destructed "+link.getName());
   }
 
     Msg.info("Trace: NetworkLink destructed "+link.getName());
   }
 
-  public void networkLinkStateChangedCallback(NetworkLink link){
+  public void networkLinkStateChangedCallback(NetworkLink link, ResourceState old, ResourceState cur){
     Msg.info("Trace: NetworkLink state changed "+link.getName());
   }
 
     Msg.info("Trace: NetworkLink state changed "+link.getName());
   }
 
-  public void networkActionStateChangedCallback(NetworkAction action){
+  public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur){
     Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
   }
 
     Msg.info("Trace: NetworkAction state changed "+action.getModel().getName());
   }
 
index d860b98..4f247b1 100644 (file)
@@ -111,3 +111,20 @@ struct s_xbt_dict {
   char *getValue(char *key) {return (char*)xbt_dict_get_or_null($self, key);}
 }
 };
   char *getValue(char *key) {return (char*)xbt_dict_get_or_null($self, key);}
 }
 };
+
+%rename e_surf_action_state_t ActionState;
+typedef enum {
+  SURF_ACTION_READY = 0,        /**< Ready        */
+  SURF_ACTION_RUNNING,          /**< Running      */
+  SURF_ACTION_FAILED,           /**< Task Failure */
+  SURF_ACTION_DONE,             /**< Completed    */
+  SURF_ACTION_TO_FREE,          /**< Action to free in next cleanup */
+  SURF_ACTION_NOT_IN_THE_SYSTEM
+                                /**< Not in the system anymore. Why did you ask ? */
+} e_surf_action_state_t;
+
+%rename e_surf_resource_state_t ResourceState;
+typedef enum {
+  SURF_RESOURCE_ON = 1,                   /**< Up & ready        */
+  SURF_RESOURCE_OFF = 0                   /**< Down & broken     */
+} e_surf_resource_state_t;
index 32f557f..5432d48 100644 (file)
@@ -39,11 +39,11 @@ void Plugin::activateCpuDestructedCallback(){
 }
 
 void Plugin::activateCpuStateChangedCallback(){
 }
 
 void Plugin::activateCpuStateChangedCallback(){
-  surf_callback_connect(cpuStateChangedCallbacks, boost::bind(&Plugin::cpuStateChangedCallback, this, _1));
+  surf_callback_connect(cpuStateChangedCallbacks, boost::bind(&Plugin::cpuStateChangedCallback, this, _1, _2, _3));
 }
 
 void Plugin::activateCpuActionStateChangedCallback(){
 }
 
 void Plugin::activateCpuActionStateChangedCallback(){
-  surf_callback_connect(cpuActionStateChangedCallbacks, boost::bind(&Plugin::cpuActionStateChangedCallback, this, _1));
+  surf_callback_connect(cpuActionStateChangedCallbacks, boost::bind(&Plugin::cpuActionStateChangedCallback, this, _1, _2, _3));
 }
 
 
 }
 
 
@@ -56,11 +56,11 @@ void Plugin::activateNetworkLinkDestructedCallback(){
 }
 
 void Plugin::activateNetworkLinkStateChangedCallback(){
 }
 
 void Plugin::activateNetworkLinkStateChangedCallback(){
-  surf_callback_connect(networkLinkStateChangedCallbacks, boost::bind(&Plugin::networkLinkStateChangedCallback, this, _1));
+  surf_callback_connect(networkLinkStateChangedCallbacks, boost::bind(&Plugin::networkLinkStateChangedCallback, this, _1, _2, _3));
 }
 
 void Plugin::activateNetworkActionStateChangedCallback(){
 }
 
 void Plugin::activateNetworkActionStateChangedCallback(){
-  surf_callback_connect(networkActionStateChangedCallbacks, boost::bind(&Plugin::networkActionStateChangedCallback, this, _1));
+  surf_callback_connect(networkActionStateChangedCallbacks, boost::bind(&Plugin::networkActionStateChangedCallback, this, _1, _2, _3));
 }
 
 
 }
 
 
index 1c51c7b..2fad2c3 100644 (file)
@@ -25,10 +25,10 @@ public:
  virtual void cpuDestructedCallback(Cpu *cpu) {}
 
  void activateCpuStateChangedCallback();
  virtual void cpuDestructedCallback(Cpu *cpu) {}
 
  void activateCpuStateChangedCallback();
- virtual void cpuStateChangedCallback(Cpu *cpu) {}
+ virtual void cpuStateChangedCallback(Cpu *cpu, e_surf_resource_state_t, e_surf_resource_state_t) {}
 
  void activateCpuActionStateChangedCallback();
 
  void activateCpuActionStateChangedCallback();
- virtual void cpuActionStateChangedCallback(CpuAction *action) {}
+ virtual void cpuActionStateChangedCallback(CpuAction *action, e_surf_action_state_t, e_surf_action_state_t) {}
 
 
  void activateNetworkLinkCreatedCallback();
 
 
  void activateNetworkLinkCreatedCallback();
@@ -38,10 +38,10 @@ public:
  virtual void networkLinkDestructedCallback(NetworkLink *link) {}
 
  void activateNetworkLinkStateChangedCallback();
  virtual void networkLinkDestructedCallback(NetworkLink *link) {}
 
  void activateNetworkLinkStateChangedCallback();
- virtual void networkLinkStateChangedCallback(NetworkLink *link) {}
+ virtual void networkLinkStateChangedCallback(NetworkLink *link, e_surf_resource_state_t, e_surf_resource_state_t) {}
 
  void activateNetworkActionStateChangedCallback();
 
  void activateNetworkActionStateChangedCallback();
- virtual void networkActionStateChangedCallback(NetworkAction *action) {}
+ virtual void networkActionStateChangedCallback(NetworkAction *action, e_surf_action_state_t old, e_surf_action_state_t cur) {}
 
 };
 
 
 };
 
index 736b29e..246f48f 100644 (file)
@@ -25,8 +25,8 @@ CpuPtr getActionCpu(CpuActionPtr action) {
 
 surf_callback(void, CpuPtr) cpuCreatedCallbacks;
 surf_callback(void, CpuPtr) cpuDestructedCallbacks;
 
 surf_callback(void, CpuPtr) cpuCreatedCallbacks;
 surf_callback(void, CpuPtr) cpuDestructedCallbacks;
-surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
-surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
+surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
+surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -203,8 +203,9 @@ int Cpu::getCore()
 
 void Cpu::setState(e_surf_resource_state_t state)
 {
 
 void Cpu::setState(e_surf_resource_state_t state)
 {
+  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
   Resource::setState(state);
-  surf_callback_emit(cpuStateChangedCallbacks, this);
+  surf_callback_emit(cpuStateChangedCallbacks, this, old, state);
 }
 /**********
  * Action *
 }
 /**********
  * Action *
@@ -309,6 +310,7 @@ void CpuAction::setAffinity(CpuPtr cpu, unsigned long mask)
 }
 
 void CpuAction::setState(e_surf_action_state_t state){
 }
 
 void CpuAction::setState(e_surf_action_state_t state){
+  e_surf_action_state_t old = getState();
   Action::setState(state);
   Action::setState(state);
-  surf_callback_emit(cpuActionStateChangedCallbacks, this);
+  surf_callback_emit(cpuActionStateChangedCallbacks, this, old, state);
 }
 }
index c72e0f5..7e2203f 100644 (file)
@@ -31,28 +31,28 @@ typedef CpuPlugin *CpuPluginPtr;
 CpuPtr getActionCpu(CpuActionPtr action);
 
 /** @ingroup SURF_callbacks
 CpuPtr getActionCpu(CpuActionPtr action);
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu creation * 
+ * @brief Callbacks handler which emit the callbacks after Cpu creation *
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu destruction * 
+ * @brief Callbacks handler which emit the callbacks after Cpu destruction *
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @details Callback functions have the following signature: `void(CpuPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu State changed * 
- * @details Callback functions have the following signature: `void(CpuActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after Cpu State changed *
+ * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-extern surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
+extern surf_callback(void, CpuPtr, e_surf_resource_state_t, e_surf_resource_state_t) cpuStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after CpuAction State changed * 
- * @details Callback functions have the following signature: `void(CpuActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
+ * @details Callback functions have the following signature: `void(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
  */
  */
-extern surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
+extern surf_callback(void, CpuActionPtr, e_surf_action_state_t, e_surf_action_state_t) cpuActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -66,16 +66,16 @@ class CpuModel : public Model {
 public:
   /**
    * @brief CpuModel constructor
 public:
   /**
    * @brief CpuModel constructor
-   * 
+   *
    * @param name The name of the model
    */
   CpuModel(const char *name) : Model(name) {};
 
   /**
    * @brief Create a Cpu
    * @param name The name of the model
    */
   CpuModel(const char *name) : Model(name) {};
 
   /**
    * @brief Create a Cpu
-   * 
+   *
    * @param name The name of the Cpu
    * @param name The name of the Cpu
-   * 
+   *
    * @return The created Cpu
    */
   CpuPtr createResource(string name);
    * @return The created Cpu
    */
   CpuPtr createResource(string name);
@@ -105,7 +105,7 @@ public:
 
   /**
    * @brief Cpu constructor
 
   /**
    * @brief Cpu constructor
-   * 
+   *
    * @param model The CpuModel associated to this Cpu
    * @param name The name of the Cpu
    * @param props Dictionary of properties associated to this Cpu
    * @param model The CpuModel associated to this Cpu
    * @param name The name of the Cpu
    * @param props Dictionary of properties associated to this Cpu
@@ -119,7 +119,7 @@ public:
 
   /**
    * @brief Cpu constructor
 
   /**
    * @brief Cpu constructor
-   * 
+   *
    * @param model The CpuModel associated to this Cpu
    * @param name The name of the Cpu
    * @param props Dictionary of properties associated to this Cpu
    * @param model The CpuModel associated to this Cpu
    * @param name The name of the Cpu
    * @param props Dictionary of properties associated to this Cpu
@@ -137,7 +137,7 @@ public:
 
   /**
    * @brief Execute some quantity of computation
 
   /**
    * @brief Execute some quantity of computation
-   * 
+   *
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    */
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    */
@@ -145,7 +145,7 @@ public:
 
   /**
    * @brief Make a process sleep for duration (in seconds)
 
   /**
    * @brief Make a process sleep for duration (in seconds)
-   * 
+   *
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    */
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    */
@@ -153,7 +153,7 @@ public:
 
   /**
    * @brief Get the number of cores of the current Cpu
 
   /**
    * @brief Get the number of cores of the current Cpu
-   * 
+   *
    * @return The number of cores of the current Cpu
    */
   virtual int getCore();
    * @return The number of cores of the current Cpu
    */
   virtual int getCore();
@@ -161,9 +161,9 @@ public:
   /**
    * @brief Get the speed of the current Cpu
    * @details [TODO] load * m_powerPeak
   /**
    * @brief Get the speed of the current Cpu
    * @details [TODO] load * m_powerPeak
-   * 
+   *
    * @param load [TODO]
    * @param load [TODO]
-   * 
+   *
    * @return The speed of the current Cpu
    */
   virtual double getSpeed(double load);
    * @return The speed of the current Cpu
    */
   virtual double getSpeed(double load);
@@ -171,23 +171,23 @@ public:
   /**
    * @brief Get the available speed of the current Cpu
    * @details [TODO]
   /**
    * @brief Get the available speed of the current Cpu
    * @details [TODO]
-   * 
+   *
    * @return The available speed of the current Cpu
    */
   virtual double getAvailableSpeed();
 
   /**
    * @brief Get the current Cpu power peak
    * @return The available speed of the current Cpu
    */
   virtual double getAvailableSpeed();
 
   /**
    * @brief Get the current Cpu power peak
-   * 
+   *
    * @return The current Cpu power peak
    */
   virtual double getCurrentPowerPeak()=0;
 
 
   virtual double getPowerPeakAt(int pstate_index)=0;
    * @return The current Cpu power peak
    */
   virtual double getCurrentPowerPeak()=0;
 
 
   virtual double getPowerPeakAt(int pstate_index)=0;
-  
+
   virtual int getNbPstates()=0;
   virtual int getNbPstates()=0;
-  
+
   virtual void setPowerPeakAt(int pstate_index)=0;
 
   void setState(e_surf_resource_state_t state);
   virtual void setPowerPeakAt(int pstate_index)=0;
 
   void setState(e_surf_resource_state_t state);
@@ -220,7 +220,7 @@ public:
 
   /**
    * @brief CpuAction constructor
 
   /**
    * @brief CpuAction constructor
-   * 
+   *
    * @param model The CpuModel associated to this CpuAction
    * @param cost [TODO]
    * @param failed [TODO]
    * @param model The CpuModel associated to this CpuAction
    * @param cost [TODO]
    * @param failed [TODO]
@@ -230,7 +230,7 @@ public:
 
   /**
    * @brief CpuAction constructor
 
   /**
    * @brief CpuAction constructor
-   * 
+   *
    * @param model The CpuModel associated to this CpuAction
    * @param cost [TODO]
    * @param failed [TODO]
    * @param model The CpuModel associated to this CpuAction
    * @param cost [TODO]
    * @param failed [TODO]
@@ -242,7 +242,7 @@ public:
   /**
    * @brief Set the affinity of the current CpuAction
    * @details [TODO]
   /**
    * @brief Set the affinity of the current CpuAction
    * @details [TODO]
-   * 
+   *
    * @param cpu [TODO]
    * @param mask [TODO]
    */
    * @param cpu [TODO]
    * @param mask [TODO]
    */
index 49e4c6d..f6d1863 100644 (file)
@@ -19,8 +19,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
 
 surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
 surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
 
 surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
 surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
-surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks;
-surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks;
+surf_callback(void, NetworkLinkPtr, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
+surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -89,8 +89,9 @@ bool NetworkLink::isShared()
 }
 
 void NetworkLink::setState(e_surf_resource_state_t state){
 }
 
 void NetworkLink::setState(e_surf_resource_state_t state){
+  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
   Resource::setState(state);
-  surf_callback_emit(networkLinkStateChangedCallbacks, this);
+  surf_callback_emit(networkLinkStateChangedCallbacks, this, old, state);
 }
 
 /**********
 }
 
 /**********
@@ -98,8 +99,10 @@ void NetworkLink::setState(e_surf_resource_state_t state){
  **********/
 
 void NetworkAction::setState(e_surf_action_state_t state){
  **********/
 
 void NetworkAction::setState(e_surf_action_state_t state){
+  e_surf_action_state_t old = getState();
   Action::setState(state);
   Action::setState(state);
-  surf_callback_emit(networkActionStateChangedCallbacks, this);
+  surf_callback_emit(networkActionStateChangedCallbacks, this, old, state);
+
 }
 
 #endif /* NETWORK_INTERFACE_CPP_ */
 }
 
 #endif /* NETWORK_INTERFACE_CPP_ */
index 8988357..37241e4 100644 (file)
@@ -27,28 +27,28 @@ typedef NetworkAction *NetworkActionPtr;
  *************/
 
 /** @ingroup SURF_callbacks
  *************/
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink creation *
+ * @brief Callbacks handler which emit the callbacks after NetworkLink creation
  * @details Callback functions have the following signature: `void(NetworkLinkPtr)`
  */
 extern surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @details Callback functions have the following signature: `void(NetworkLinkPtr)`
  */
 extern surf_callback(void, NetworkLinkPtr) networkLinkCreatedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink destruction *
+ * @brief Callbacks handler which emit the callbacks after NetworkLink destruction
  * @details Callback functions have the following signature: `void(NetworkLinkPtr)`
  */
 extern surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @details Callback functions have the following signature: `void(NetworkLinkPtr)`
  */
 extern surf_callback(void, NetworkLinkPtr) networkLinkDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkLink State changed *
- * @details Callback functions have the following signature: `void(NetworkLinkActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after NetworkLink State changed
+ * @details Callback functions have the following signature: `void(NetworkLinkActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-extern surf_callback(void, NetworkLinkPtr) networkLinkStateChangedCallbacks;
+extern surf_callback(void, NetworkLinkPtr, e_surf_resource_state_t, e_surf_resource_state_t) networkLinkStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
 
 /** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after NetworkAction State changed *
- * @details Callback functions have the following signature: `void(NetworkActionPtr)`
+ * @brief Callbacks handler which emit the callbacks after NetworkAction State changed
+ * @details Callback functions have the following signature: `void(NetworkActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
  */
  */
-extern surf_callback(void, NetworkActionPtr) networkActionStateChangedCallbacks;
+extern surf_callback(void, NetworkActionPtr, e_surf_action_state_t, e_surf_action_state_t) networkActionStateChangedCallbacks;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -73,7 +73,7 @@ public:
 
   /**
    * @brief NetworkModel constructor
 
   /**
    * @brief NetworkModel constructor
-   * 
+   *
    * @param name The name of the NetworkModel
    */
   NetworkModel(const char *name) : Model(name) {
    * @param name The name of the NetworkModel
    */
   NetworkModel(const char *name) : Model(name) {
@@ -95,7 +95,7 @@ public:
 
   /**
    * @brief Create a NetworkLink
 
   /**
    * @brief Create a NetworkLink
-   * 
+   *
    * @param name The name of the NetworkLink
    * @param bw_initial The initial bandwidth of the NetworkLink in bytes per second
    * @param bw_trace The trace associated to the NetworkLink bandwidth [TODO]
    * @param name The name of the NetworkLink
    * @param bw_initial The initial bandwidth of the NetworkLink in bytes per second
    * @param bw_trace The trace associated to the NetworkLink bandwidth [TODO]
@@ -123,11 +123,11 @@ public:
   /**
    * @brief Create a communication between two [TODO]
    * @details [TODO]
   /**
    * @brief Create a communication between two [TODO]
    * @details [TODO]
-   * 
+   *
    * @param src The source [TODO]
    * @param dst The destination [TODO]
    * @param size The size of the communication in bytes
    * @param src The source [TODO]
    * @param dst The destination [TODO]
    * @param size The size of the communication in bytes
-   * @param rate The 
+   * @param rate The
    * @return The action representing the communication
    */
   virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
    * @return The action representing the communication
    */
   virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
@@ -135,7 +135,7 @@ public:
 
   /**
    * @brief Function pointer to the function to use to solve the lmm_system_t
 
   /**
    * @brief Function pointer to the function to use to solve the lmm_system_t
-   * 
+   *
    * @param system The lmm_system_t to solve
    */
   void (*f_networkSolve)(lmm_system_t);
    * @param system The lmm_system_t to solve
    */
   void (*f_networkSolve)(lmm_system_t);
@@ -143,7 +143,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
   /**
    * @brief [brief description]
    * @details [long description]
-   * 
+   *
    * @param size [description]
    * @return [description]
    */
    * @param size [description]
    * @return [description]
    */
@@ -152,7 +152,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
   /**
    * @brief [brief description]
    * @details [long description]
-   * 
+   *
    * @param size [description]
    * @return [description]
    */
    * @param size [description]
    * @return [description]
    */
@@ -161,7 +161,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
   /**
    * @brief [brief description]
    * @details [long description]
-   * 
+   *
    * @param rate [description]
    * @param bound [description]
    * @param size [description]
    * @param rate [description]
    * @param bound [description]
    * @param size [description]
@@ -182,7 +182,7 @@ class NetworkLink : public Resource {
 public:
   /**
    * @brief NetworkLink constructor
 public:
   /**
    * @brief NetworkLink constructor
-   * 
+   *
    * @param model The CpuModel associated to this NetworkLink
    * @param name The name of the NetworkLink
    * @param props Dictionary of properties associated to this NetworkLink
    * @param model The CpuModel associated to this NetworkLink
    * @param name The name of the NetworkLink
    * @param props Dictionary of properties associated to this NetworkLink
@@ -191,7 +191,7 @@ public:
 
   /**
    * @brief NetworkLink constructor
 
   /**
    * @brief NetworkLink constructor
-   * 
+   *
    * @param model The CpuModel associated to this NetworkLink
    * @param name The name of the NetworkLink
    * @param props Dictionary of properties associated to this NetworkLink
    * @param model The CpuModel associated to this NetworkLink
    * @param name The name of the NetworkLink
    * @param props Dictionary of properties associated to this NetworkLink
@@ -211,14 +211,14 @@ public:
 
   /**
    * @brief Get the bandwidth in bytes per second of current NetworkLink
 
   /**
    * @brief Get the bandwidth in bytes per second of current NetworkLink
-   * 
+   *
    * @return The bandwith in bytes per second of the current NetworkLink
    */
   virtual double getBandwidth();
 
   /**
    * @brief Get the latency in seconds of current NetworkLink
    * @return The bandwith in bytes per second of the current NetworkLink
    */
   virtual double getBandwidth();
 
   /**
    * @brief Get the latency in seconds of current NetworkLink
-   * 
+   *
    * @return The latency in seconds of the current NetworkLink
    */
   virtual double getLatency();
    * @return The latency in seconds of the current NetworkLink
    */
   virtual double getLatency();
@@ -226,14 +226,14 @@ public:
   /**
    * @brief Check if the NetworkLink is shared
    * @details [long description]
   /**
    * @brief Check if the NetworkLink is shared
    * @details [long description]
-   * 
+   *
    * @return true if the current NetwokrLink is shared, false otherwise
    */
   virtual bool isShared();
 
   /**
    * @brief Check if the NetworkLink is used
    * @return true if the current NetwokrLink is shared, false otherwise
    */
   virtual bool isShared();
 
   /**
    * @brief Check if the NetworkLink is used
-   * 
+   *
    * @return true if the current NetwokrLink is used, false otherwise
    */
   bool isUsed();
    * @return true if the current NetwokrLink is used, false otherwise
    */
   bool isUsed();
@@ -261,7 +261,7 @@ class NetworkAction : public Action {
 public:
   /**
    * @brief NetworkAction constructor
 public:
   /**
    * @brief NetworkAction constructor
-   * 
+   *
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
@@ -271,7 +271,7 @@ public:
 
   /**
    * @brief NetworkAction constructor
 
   /**
    * @brief NetworkAction constructor
-   * 
+   *
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    * @param model The NetworkModel associated to this NetworkAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
index 993ac0b..4fd94ac 100644 (file)
@@ -8,8 +8,8 @@
 #include "../cpu_cas01.hpp"
 
 /** @addtogroup SURF_plugin_energy
 #include "../cpu_cas01.hpp"
 
 /** @addtogroup SURF_plugin_energy
- *    
- *  
+ *
+ *
  *  BlaBla energy
  */
 
  *  BlaBla energy
  */
 
@@ -31,7 +31,7 @@ static void energyCpuDestructedCallback(CpuPtr cpu){
   surf_energy->erase(cpuIt);
 }
 
   surf_energy->erase(cpuIt);
 }
 
-static void energyCpuActionStateChangedCallback(CpuActionPtr action){
+static void energyCpuActionStateChangedCallback(CpuActionPtr action, e_surf_action_state_t old, e_surf_action_state_t cur){
   CpuPtr cpu  = getActionCpu(action);
   CpuEnergyPtr cpu_energy = (*surf_energy)[cpu];
 
   CpuPtr cpu  = getActionCpu(action);
   CpuEnergyPtr cpu_energy = (*surf_energy)[cpu];
 
index 5e1ef73..d1c824d 100644 (file)
@@ -26,8 +26,8 @@ StorageModelPtr surf_storage_model = NULL;
 
 surf_callback(void, StoragePtr) storageCreatedCallbacks;
 surf_callback(void, StoragePtr) storageDestructedCallbacks;
 
 surf_callback(void, StoragePtr) storageCreatedCallbacks;
 surf_callback(void, StoragePtr) storageDestructedCallbacks;
-surf_callback(void, StoragePtr) storageStateChangedCallbacks;
-surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks;
+surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
+surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -138,8 +138,9 @@ void Storage::updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, d
 
 void Storage::setState(e_surf_resource_state_t state)
 {
 
 void Storage::setState(e_surf_resource_state_t state)
 {
+  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
   Resource::setState(state);
-  surf_callback_emit(storageStateChangedCallbacks, this);
+  surf_callback_emit(storageStateChangedCallbacks, this, old, state);
 }
 
 xbt_dict_t Storage::getContent()
 }
 
 xbt_dict_t Storage::getContent()
@@ -179,6 +180,7 @@ StorageAction::StorageAction(ModelPtr model, double cost, bool failed, lmm_varia
 }
 
 void StorageAction::setState(e_surf_action_state_t state){
 }
 
 void StorageAction::setState(e_surf_action_state_t state){
+  e_surf_action_state_t old = getState();
   Action::setState(state);
   Action::setState(state);
-  surf_callback_emit(storageActionStateChangedCallbacks, this);
+  surf_callback_emit(storageActionStateChangedCallbacks, this, old, state);
 }
 }
index c63d044..d0e7df6 100644 (file)
@@ -48,15 +48,15 @@ extern surf_callback(void, StoragePtr) storageDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Storage State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr)`
+ * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-extern surf_callback(void, StoragePtr) storageStateChangedCallbacks;
+extern surf_callback(void, StoragePtr, e_surf_resource_state_t, e_surf_resource_state_t) storageStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after StorageAction State changed *
- * @details Callback functions have the following signature: `void(StorageActionPtr)`
+ * @details Callback functions have the following signature: `void(StorageActionPtr action, e_surf_action_state_t old, e_surf_action_state_t current)`
  */
  */
-extern surf_callback(void, StorageActionPtr) storageActionStateChangedCallbacks;
+extern surf_callback(void, StorageActionPtr, e_surf_action_state_t, e_surf_action_state_t) storageActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -79,7 +79,7 @@ public:
 
   /**
    * @brief Create a Storage
 
   /**
    * @brief Create a Storage
-   * 
+   *
    * @param id [description]
    * @param type_id [description]
    * @param content_name [description]
    * @param id [description]
    * @param type_id [description]
    * @param content_name [description]
@@ -109,7 +109,7 @@ class Storage : public Resource {
 public:
   /**
    * @brief Storage constructor
 public:
   /**
    * @brief Storage constructor
-   * 
+   *
    * @param model StorageModel associated to this Storage
    * @param name The name of the Storage
    * @param props Dictionary of properties associated to this Storage
    * @param model StorageModel associated to this Storage
    * @param name The name of the Storage
    * @param props Dictionary of properties associated to this Storage
@@ -124,7 +124,7 @@ public:
 
   /**
    * @brief Storage constructor
 
   /**
    * @brief Storage constructor
-   * 
+   *
    * @param model StorageModel associated to this Storage
    * @param name The name of the Storage
    * @param props Dictionary of properties associated to this Storage
    * @param model StorageModel associated to this Storage
    * @param name The name of the Storage
    * @param props Dictionary of properties associated to this Storage
@@ -151,14 +151,14 @@ public:
 
   /**
    * @brief Check if the Storage is used
 
   /**
    * @brief Check if the Storage is used
-   * 
+   *
    * @return true if the current Storage is used, false otherwise
    */
   bool isUsed();
 
   /**
    * @brief Update the state of the current Storage
    * @return true if the current Storage is used, false otherwise
    */
   bool isUsed();
 
   /**
    * @brief Update the state of the current Storage
-   * 
+   *
    * @param event_type [description]
    * @param value [description]
    * @param date [description]
    * @param event_type [description]
    * @param value [description]
    * @param date [description]
@@ -176,17 +176,17 @@ public:
 
   /**
    * @brief Open a file
 
   /**
    * @brief Open a file
-   * 
+   *
    * @param mount The mount point
    * @param path The path to the file
    * @param mount The mount point
    * @param path The path to the file
-   * 
+   *
    * @return The StorageAction corresponding to the opening
    */
   virtual StorageActionPtr open(const char* mount, const char* path)=0;
 
   /**
    * @brief Close a file
    * @return The StorageAction corresponding to the opening
    */
   virtual StorageActionPtr open(const char* mount, const char* path)=0;
 
   /**
    * @brief Close a file
-   * 
+   *
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
@@ -195,7 +195,7 @@ public:
   /**
    * @brief List directory contents of a path
    * @details [long description]
   /**
    * @brief List directory contents of a path
    * @details [long description]
-   * 
+   *
    * @param path The path to the directory
    * @return The StorageAction corresponding to the ls action
    */
    * @param path The path to the directory
    * @return The StorageAction corresponding to the ls action
    */
@@ -203,7 +203,7 @@ public:
 
   /**
    * @brief Read a file
 
   /**
    * @brief Read a file
-   * 
+   *
    * @param fd The file descriptor to read
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
    * @param fd The file descriptor to read
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
@@ -212,7 +212,7 @@ public:
 
   /**
    * @brief Write a file
 
   /**
    * @brief Write a file
-   * 
+   *
    * @param fd The file descriptor to write
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
    * @param fd The file descriptor to write
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
@@ -221,14 +221,14 @@ public:
 
   /**
    * @brief Get the content of the current Storage
 
   /**
    * @brief Get the content of the current Storage
-   * 
+   *
    * @return A xbt_dict_t with path as keys and size in bytes as values
    */
   virtual xbt_dict_t getContent();
 
   /**
    * @brief Get the size in bytes of the current Storage
    * @return A xbt_dict_t with path as keys and size in bytes as values
    */
   virtual xbt_dict_t getContent();
 
   /**
    * @brief Get the size in bytes of the current Storage
-   * 
+   *
    * @return The size in bytes of the current Storage
    */
   virtual sg_size_t getSize();
    * @return The size in bytes of the current Storage
    */
   virtual sg_size_t getSize();
@@ -269,7 +269,7 @@ public:
 
   /**
    * @brief StorageAction constructor
 
   /**
    * @brief StorageAction constructor
-   * 
+   *
    * @param model The StorageModel associated to this StorageAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
    * @param model The StorageModel associated to this StorageAction
    * @param cost The cost of this  NetworkAction in [TODO]
    * @param failed [description]
@@ -281,7 +281,7 @@ public:
 
     /**
    * @brief StorageAction constructor
 
     /**
    * @brief StorageAction constructor
-   * 
+   *
    * @param model The StorageModel associated to this StorageAction
    * @param cost The cost of this  StorageAction in [TODO]
    * @param failed [description]
    * @param model The StorageModel associated to this StorageAction
    * @param cost The cost of this  StorageAction in [TODO]
    * @param failed [description]
index b04b719..dae99c9 100644 (file)
@@ -22,8 +22,8 @@ WorkstationModelPtr surf_workstation_model = NULL;
 
 surf_callback(void, WorkstationPtr) workstationCreatedCallbacks;
 surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
 
 surf_callback(void, WorkstationPtr) workstationCreatedCallbacks;
 surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
-surf_callback(void, WorkstationPtr) workstationStateChangedCallbacks;
-surf_callback(void, WorkstationActionPtr) workstationActionStateChangedCallbacks;
+surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
+surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
 
 /*********
  * Model *
 
 /*********
  * Model *
@@ -112,8 +112,9 @@ Workstation::~Workstation(){
 }
 
 void Workstation::setState(e_surf_resource_state_t state){
 }
 
 void Workstation::setState(e_surf_resource_state_t state){
+  e_surf_resource_state_t old = Resource::getState();
   Resource::setState(state);
   Resource::setState(state);
-  surf_callback_emit(workstationStateChangedCallbacks, this);
+  surf_callback_emit(workstationStateChangedCallbacks, this, old, state);
 }
 
 int Workstation::getCore(){
 }
 
 int Workstation::getCore(){
@@ -507,6 +508,7 @@ void Workstation::setParams(ws_params_t params)
  **********/
 
 void WorkstationAction::setState(e_surf_action_state_t state){
  **********/
 
 void WorkstationAction::setState(e_surf_action_state_t state){
+  e_surf_action_state_t old = getState();
   Action::setState(state);
   Action::setState(state);
-  surf_callback_emit(workstationActionStateChangedCallbacks, this);
+  surf_callback_emit(workstationActionStateChangedCallbacks, this, old, state);
 }
 }
index c472d37..799ee13 100644 (file)
@@ -43,15 +43,15 @@ extern surf_callback(void, WorkstationPtr) workstationDestructedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Workstation State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Workstation State changed *
- * @details Callback functions have the following signature: `void(WorkstationActionPtr)`
+ * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-extern surf_callback(void, WorkstationPtr) workstationStateChangedCallbacks;
+extern surf_callback(void, WorkstationPtr, e_surf_resource_state_t, e_surf_resource_state_t) workstationStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after WorkstationAction State changed *
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after WorkstationAction State changed *
- * @details Callback functions have the following signature: `void(WorkstationActionPtr)`
+ * @details Callback functions have the following signature: `void(WorkstationActionPtr action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
  */
  */
-extern surf_callback(void, WorkstationActionPtr) workstationActionStateChangedCallbacks;
+extern surf_callback(void, WorkstationActionPtr, e_surf_action_state_t, e_surf_action_state_t) workstationActionStateChangedCallbacks;
 
 /*********
  * Tools *
 
 /*********
  * Tools *
@@ -67,9 +67,9 @@ extern WorkstationModelPtr surf_workstation_model;
  */
 class WorkstationModel : public Model {
 public:
  */
 class WorkstationModel : public Model {
 public:
-    /** 
+    /**
    * @brief WorkstationModel constructor
    * @brief WorkstationModel constructor
-   * 
+   *
    * @param name the name of the model
    */
   WorkstationModel(const char *name);
    * @param name the name of the model
    */
   WorkstationModel(const char *name);
@@ -89,11 +89,11 @@ public:
    * @details [long description]
    */
   virtual void adjustWeightOfDummyCpuActions();
    * @details [long description]
    */
   virtual void adjustWeightOfDummyCpuActions();
-  
+
   /**
    * @brief [brief description]
    * @details [long description]
   /**
    * @brief [brief description]
    * @details [long description]
-   * 
+   *
    * @param workstation_nb [description]
    * @param workstation_list [description]
    * @param computation_amount [description]
    * @param workstation_nb [description]
    * @param workstation_list [description]
    * @param computation_amount [description]
@@ -110,7 +110,7 @@ public:
  /**
   * @brief [brief description]
   * @details [long description]
  /**
   * @brief [brief description]
   * @details [long description]
-  * 
+  *
   * @param src [description]
   * @param dst [description]
   * @param size [description]
   * @param src [description]
   * @param dst [description]
   * @param size [description]
@@ -138,7 +138,7 @@ public:
 
   /**
    * @brief Workstation constructor
 
   /**
    * @brief Workstation constructor
-   * 
+   *
    * @param model WorkstationModel associated to this Workstation
    * @param name The name of the Workstation
    * @param props Dictionary of properties associated to this Workstation
    * @param model WorkstationModel associated to this Workstation
    * @param name The name of the Workstation
    * @param props Dictionary of properties associated to this Workstation
@@ -151,7 +151,7 @@ public:
 
   /**
    * @brief Workstation constructor
 
   /**
    * @brief Workstation constructor
-   * 
+   *
    * @param model WorkstationModel associated to this Workstation
    * @param name The name of the Workstation
    * @param props Dictionary of properties associated to this Workstation
    * @param model WorkstationModel associated to this Workstation
    * @param name The name of the Workstation
    * @param props Dictionary of properties associated to this Workstation
@@ -179,7 +179,7 @@ public:
 
   /**
    * @brief Execute some quantity of computation
 
   /**
    * @brief Execute some quantity of computation
-   * 
+   *
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    * @see Cpu
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    * @see Cpu
@@ -188,7 +188,7 @@ public:
 
   /**
    * @brief Make a process sleep for duration seconds
 
   /**
    * @brief Make a process sleep for duration seconds
-   * 
+   *
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    * @see Cpu
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    * @see Cpu
@@ -197,7 +197,7 @@ public:
 
   /**
    * @brief Get the number of cores of the associated Cpu
 
   /**
    * @brief Get the number of cores of the associated Cpu
-   * 
+   *
    * @return The number of cores of the associated Cpu
    * @see Cpu
    */
    * @return The number of cores of the associated Cpu
    * @see Cpu
    */
@@ -205,7 +205,7 @@ public:
 
   /**
    * @brief Get the speed of the associated Cpu
 
   /**
    * @brief Get the speed of the associated Cpu
-   * 
+   *
    * @param load [TODO]
    * @return The speed of the associated Cpu
    * @see Cpu
    * @param load [TODO]
    * @return The speed of the associated Cpu
    * @see Cpu
@@ -215,7 +215,7 @@ public:
   /**
    * @brief Get the available speed of the associated Cpu
    * @details [TODO]
   /**
    * @brief Get the available speed of the associated Cpu
    * @details [TODO]
-   * 
+   *
    * @return The available speed of the associated Cpu
    * @see Cpu
    */
    * @return The available speed of the associated Cpu
    * @see Cpu
    */
@@ -223,7 +223,7 @@ public:
 
   /**
    * @brief Get the associated Cpu power peak
 
   /**
    * @brief Get the associated Cpu power peak
-   * 
+   *
    * @return The associated Cpu power peak
    * @see Cpu
    */
    * @return The associated Cpu power peak
    * @see Cpu
    */
@@ -235,7 +235,7 @@ public:
 
   /**
    * @brief Return the storage of corresponding mount point
 
   /**
    * @brief Return the storage of corresponding mount point
-   * 
+   *
    * @param storage The mount point
    * @return The corresponding Storage
    */
    * @param storage The mount point
    * @return The corresponding Storage
    */
@@ -243,7 +243,7 @@ public:
 
   /**
    * @brief Get the xbt_dict_t of mount_point: Storage
 
   /**
    * @brief Get the xbt_dict_t of mount_point: Storage
-   * 
+   *
    * @return The xbt_dict_t of mount_point: Storage
    */
   virtual xbt_dict_t getMountedStorageList();
    * @return The xbt_dict_t of mount_point: Storage
    */
   virtual xbt_dict_t getMountedStorageList();
@@ -257,16 +257,16 @@ public:
 
   /**
    * @brief Open a file
 
   /**
    * @brief Open a file
-   * 
+   *
    * @param fullpath The full path to the file
    * @param fullpath The full path to the file
-   * 
+   *
    * @return The StorageAction corresponding to the opening
    */
   virtual ActionPtr open(const char* fullpath);
 
   /**
    * @brief Close a file
    * @return The StorageAction corresponding to the opening
    */
   virtual ActionPtr open(const char* fullpath);
 
   /**
    * @brief Close a file
-   * 
+   *
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
    * @param fd The file descriptor to close
    * @return The StorageAction corresponding to the closing
    */
@@ -275,7 +275,7 @@ public:
   /**
    * @brief Unlink a file
    * @details [long description]
   /**
    * @brief Unlink a file
    * @details [long description]
-   * 
+   *
    * @param fd [description]
    * @return [description]
    */
    * @param fd [description]
    * @return [description]
    */
@@ -284,7 +284,7 @@ public:
   /**
    * @brief List directory contents of a path
    * @details [long description]
   /**
    * @brief List directory contents of a path
    * @details [long description]
-   * 
+   *
    * @param mount [description]
    * @param path The path to the directory
    * @return The StorageAction corresponding to the ls action
    * @param mount [description]
    * @param path The path to the directory
    * @return The StorageAction corresponding to the ls action
@@ -293,7 +293,7 @@ public:
 
   /**
    * @brief Get the size in bytes of the file
 
   /**
    * @brief Get the size in bytes of the file
-   * 
+   *
    * @param fd The file descriptor to read
    * @return The size in bytes of the file
    */
    * @param fd The file descriptor to read
    * @return The size in bytes of the file
    */
@@ -301,7 +301,7 @@ public:
 
   /**
    * @brief Read a file
 
   /**
    * @brief Read a file
-   * 
+   *
    * @param fd The file descriptor to read
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
    * @param fd The file descriptor to read
    * @param size The size in bytes to read
    * @return The StorageAction corresponding to the reading
@@ -310,7 +310,7 @@ public:
 
   /**
    * @brief Write a file
 
   /**
    * @brief Write a file
-   * 
+   *
    * @param fd The file descriptor to write
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
    * @param fd The file descriptor to write
    * @param size The size in bytes to write
    * @return The StorageAction corresponding to the writing
@@ -325,7 +325,7 @@ public:
    *  - the storage name,
    *  - the storage typeId,
    *  - the storage content type
    *  - the storage name,
    *  - the storage typeId,
    *  - the storage content type
-   * 
+   *
    * @param fd The file descriptor
    * @return An xbt_dynar_t with the file informations
    */
    * @param fd The file descriptor
    * @return An xbt_dynar_t with the file informations
    */
@@ -333,15 +333,15 @@ public:
 
   /**
    * @brief Get the current position of the file descriptor
 
   /**
    * @brief Get the current position of the file descriptor
-   *  
+   *
    * @param fd The file descriptor
    * @return The current position of the file descriptor
    */
   virtual sg_size_t fileTell(surf_file_t fd);
 
   /**
    * @param fd The file descriptor
    * @return The current position of the file descriptor
    */
   virtual sg_size_t fileTell(surf_file_t fd);
 
   /**
-   * @brief Get the available space of the storage at the mount point 
-   * 
+   * @brief Get the available space of the storage at the mount point
+   *
    * @param name The mount point
    * @return The amount of availble space in bytes
    */
    * @param name The mount point
    * @return The amount of availble space in bytes
    */
@@ -349,7 +349,7 @@ public:
 
   /**
    * @brief Get the used space of the storage at the mount point
 
   /**
    * @brief Get the used space of the storage at the mount point
-   * 
+   *
    * @param name The mount point
    * @return The amount of used space in bytes
    */
    * @param name The mount point
    * @return The amount of used space in bytes
    */
@@ -358,7 +358,7 @@ public:
   /**
    * @brief Set the position indictator assiociated with the file descriptor to a new position
    * @details [long description]
   /**
    * @brief Set the position indictator assiociated with the file descriptor to a new position
    * @details [long description]
-   * 
+   *
    * @param fd The file descriptor
    * @param offset The offset from the origin
    * @param origin Position used as a reference for the offset
    * @param fd The file descriptor
    * @param offset The offset from the origin
    * @param origin Position used as a reference for the offset
@@ -398,7 +398,7 @@ public:
 
   /**
    * @brief Get the list of virtual machines on the current Workstation
 
   /**
    * @brief Get the list of virtual machines on the current Workstation
-   * 
+   *
    * @return The list of VMs
    */
   xbt_dynar_t getVms();
    * @return The list of VMs
    */
   xbt_dynar_t getVms();
@@ -407,7 +407,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
   /**
    * @brief [brief description]
    * @details [long description]
-   * 
+   *
    * @param params [description]
    */
   void getParams(ws_params_t params);
    * @param params [description]
    */
   void getParams(ws_params_t params);
@@ -415,7 +415,7 @@ public:
   /**
    * @brief [brief description]
    * @details [long description]
   /**
    * @brief [brief description]
    * @details [long description]
-   * 
+   *
    * @param params [description]
    */
   void setParams(ws_params_t params);
    * @param params [description]
    */
   void setParams(ws_params_t params);
@@ -433,7 +433,7 @@ class WorkstationAction : public Action {
 public:
   /**
    * @brief WorkstationAction constructor
 public:
   /**
    * @brief WorkstationAction constructor
-   * 
+   *
    * @param model The WorkstationModel associated to this WorkstationAction
    * @param cost The cost of this WorkstationAction in [TODO]
    * @param failed [description]
    * @param model The WorkstationModel associated to this WorkstationAction
    * @param cost The cost of this WorkstationAction in [TODO]
    * @param failed [description]
@@ -443,7 +443,7 @@ public:
 
   /**
    * @brief WorkstationAction constructor
 
   /**
    * @brief WorkstationAction constructor
-   * 
+   *
    * @param model The WorkstationModel associated to this WorkstationAction
    * @param cost The cost of this WorkstationAction in [TODO]
    * @param failed [description]
    * @param model The WorkstationModel associated to this WorkstationAction
    * @param cost The cost of this WorkstationAction in [TODO]
    * @param failed [description]