From: Frederic Suter Date: Thu, 20 Jul 2017 07:36:36 +0000 (+0200) Subject: adress smells in cpuTI X-Git-Tag: v3_17~361 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2445f119813cd1603cf3f439fd7779cf35f3f665 adress smells in cpuTI --- diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 9173e1df1f..dd6c06f665 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -665,6 +665,7 @@ CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed, CpuTi *cp : CpuAction(model_, cost, failed) , cpu_(cpu) { + indexHeap_ = -1; cpu_->modified(true); } diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 3f0fc9635a..4bdbe144ed 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -88,7 +88,7 @@ public: void setState(simgrid::surf::Action::State state) override; int unref() override; void cancel() override; - void updateIndexHeap(int i); + void updateIndexHeap(int i) override; void suspend() override; void resume() override; void setMaxDuration(double duration) override; @@ -96,8 +96,6 @@ public: double getRemains() override; CpuTi *cpu_; - int indexHeap_ = -1; - int suspended_ = 0; boost::intrusive::list_member_hook<> action_ti_hook; }; @@ -153,14 +151,6 @@ public: ActionList *runningActionSetThatDoesNotNeedBeingChecked_; CpuTiList *modifiedCpu_; xbt_heap_t tiActionHeap_; - -protected: - void NotifyResourceTurnedOn(simgrid::surf::Resource*){}; - void NotifyResourceTurnedOff(simgrid::surf::Resource*){}; - - void NotifyActionCancel(Action*){}; - void NotifyActionResume(Action*){}; - void NotifyActionSuspend(Action*){}; }; } diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index b9e8b2cc2c..a51ad073e3 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -233,7 +233,7 @@ public: void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat); void heapRemove(xbt_heap_t heap); void heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat); - void updateIndexHeap(int i); + virtual void updateIndexHeap(int i); lmm_variable_t getVariable() {return variable_;} double getLastUpdate() {return lastUpdate_;} void refreshLastUpdate() {lastUpdate_ = surf_get_clock();}