Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
m_bound belongs to CpuAction; initialize it.
[simgrid.git] / src / surf / cpu_interface.hpp
index 1178388..101359f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2013. The SimGrid Team.
+/* Copyright (c) 2004-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,25 +32,25 @@ CpuPtr getActionCpu(CpuActionPtr action);
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after Cpu creation * 
- * @detail Callback functions have the following signature: `void(CpuPtr)`
+ * @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 * 
- * @detail Callback functions have the following signature: `void(CpuPtr)`
+ * @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 * 
- * @detail Callback functions have the following signature: `void(CpuActionPtr)`
+ * @details Callback functions have the following signature: `void(CpuActionPtr)`
  */
 extern surf_callback(void, CpuPtr) cpuStateChangedCallbacks;
 
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after CpuAction State changed * 
- * @detail Callback functions have the following signature: `void(CpuActionPtr)`
+ * @details Callback functions have the following signature: `void(CpuActionPtr)`
  */
 extern surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks;
 
@@ -216,7 +216,7 @@ public:
   /**
    * @brief CpuAction constructor
    */
-  CpuAction(){};
+  CpuAction(): m_bound(0) {};
 
   /**
    * @brief CpuAction constructor
@@ -226,7 +226,7 @@ public:
    * @param failed [TODO]
    */
   CpuAction(ModelPtr model, double cost, bool failed)
-  : Action(model, cost, failed) {} //FIXME:REMOVE
+    : Action(model, cost, failed), m_bound(0) {} //FIXME:REMOVE
 
   /**
    * @brief CpuAction constructor
@@ -237,14 +237,14 @@ public:
    * @param var The lmm variable associated to this CpuAction if it is part of a LMM component
    */
   CpuAction(ModelPtr model, double cost, bool failed, lmm_variable_t var)
-  : Action(model, cost, failed, var) {}
+    : Action(model, cost, failed, var), m_bound(0) {}
 
   /**
    * @brief Set the affinity of the current CpuAction
    * @details [TODO]
    * 
    * @param cpu [TODO]
-   * @param long [TODO]
+   * @param mask [TODO]
    */
   virtual void setAffinity(CpuPtr cpu, unsigned long mask);
 
@@ -256,10 +256,17 @@ public:
    */
   virtual void setBound(double bound);
 
+  /**
+   * @brief Get the bound of the current CpuAction
+   *
+   * @return The bound of the current CpuAction
+   */
+  double getBound() { return m_bound; }
+
   void setState(e_surf_action_state_t state);
 
   void updateRemainingLazy(double now);
-  double m_bound;
+  double m_bound;                /*< the capping of the CPU use  */
 };
 
 #endif /* SURF_CPU_INTERFACE_HPP_ */