Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill unused callbacks: cpuCreated, cpuDestructed and cpuActionStateChanged
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 21 Dec 2015 16:08:31 +0000 (17:08 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 21 Dec 2015 16:08:31 +0000 (17:08 +0100)
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp

index 2f1f7df..772e86a 100644 (file)
@@ -38,10 +38,8 @@ Cpu *getActionCpu(CpuAction *action) {
                                         action->getVariable(), 0)));
 }
 
                                         action->getVariable(), 0)));
 }
 
-simgrid::surf::signal<void(Cpu*)> cpuCreatedCallbacks;
-simgrid::surf::signal<void(Cpu*)> cpuDestructedCallbacks;
-simgrid::surf::signal<void(Cpu*, e_surf_resource_state_t, e_surf_resource_state_t)> cpuStateChangedCallbacks;
 simgrid::surf::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
 simgrid::surf::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
+
 void cpu_add_traces(){
   surf_cpu_model_pm->addTraces();
 }
 void cpu_add_traces(){
   surf_cpu_model_pm->addTraces();
 }
@@ -193,7 +191,6 @@ Cpu::Cpu(Model *model, const char *name,
 
 void Cpu::onDie()
 {
 
 void Cpu::onDie()
 {
-  cpuDestructedCallbacks(this);
   Resource::onDie();
 }
 
   Resource::onDie();
 }
 
@@ -231,22 +228,12 @@ int Cpu::getCore()
   return m_core;
 }
 
   return m_core;
 }
 
-void Cpu::setState(e_surf_resource_state_t state)
-{
-  e_surf_resource_state_t old = Resource::getState();
-  Resource::setState(state);
-  cpuStateChangedCallbacks(this, old, state);
-}
-
 void Cpu::plug(simgrid::Host* host)
 {
   if (this->m_host != nullptr)
     xbt_die("Already plugged into host %s", host->id().c_str());
   host->extension_set(this);
   this->m_host = host;
 void Cpu::plug(simgrid::Host* host)
 {
   if (this->m_host != nullptr)
     xbt_die("Already plugged into host %s", host->id().c_str());
   host->extension_set(this);
   this->m_host = host;
-  simgrid::surf::cpuCreatedCallbacks(this);
-  simgrid::surf::cpuStateChangedCallbacks(this,
-    SURF_RESOURCE_ON, this->getState());
 }
 
 /**********
 }
 
 /**********
index 5e4aece..c2faaf0 100644 (file)
@@ -27,24 +27,6 @@ class CpuPlugin;
  *************/
 XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
 
  *************/
 XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
 
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu creation *
- * @details Callback functions have the following signature: `void(CpuPtr)`
- */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(Cpu*)>) cpuCreatedCallbacks;
-
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu destruction *
- * @details Callback functions have the following signature: `void(CpuPtr)`
- */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(Cpu*)>) cpuDestructedCallbacks;
-
-/** @ingroup SURF_callbacks
- * @brief Callbacks handler which emit the callbacks after Cpu State changed *
- * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_resource_state_t old, e_surf_resource_state_t current)`
- */
-XBT_PUBLIC_DATA(simgrid::surf::signal<void(Cpu*, e_surf_resource_state_t, e_surf_resource_state_t)>) cpuStateChangedCallbacks;
-
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
  * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
 /** @ingroup SURF_callbacks
  * @brief Callbacks handler which emit the callbacks after CpuAction State changed *
  * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t old, e_surf_action_state_t current)`
@@ -172,7 +154,6 @@ public:
   virtual void setPstate(int pstate_index)=0;
   virtual int  getPstate()=0;
 
   virtual void setPstate(int pstate_index)=0;
   virtual int  getPstate()=0;
 
-  void setState(e_surf_resource_state_t state);
   void plug(simgrid::Host* host);
 
   void addTraces(void);
   void plug(simgrid::Host* host);
 
   void addTraces(void);