X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/090f69e16fc2256292aa7ca819b9d80a2a51d8d4..6c56800bdad43cabb6c870c9163bbeea694d6692:/src/surf/cpu_cas01.hpp diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index 61b588bd4b..b5279e4532 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -6,17 +6,17 @@ #ifndef SIMGRID_SURF_CPUCAS01_HPP #define SIMGRID_SURF_CPUCAS01_HPP -#include "cpu_interface.hpp" +#include "src/kernel/resource/CpuImpl.hpp" #include "xbt/base.h" -/*********** - * Classes * - ***********/ - namespace simgrid { namespace kernel { namespace resource { +/*********** + * Classes * + ***********/ + class XBT_PRIVATE CpuCas01Model; class XBT_PRIVATE CpuCas01; class XBT_PRIVATE CpuCas01Action; @@ -39,6 +39,8 @@ public: ************/ class CpuCas01 : public CpuImpl { + std::function factor_cb_ = {}; + public: using CpuImpl::CpuImpl; CpuCas01(const CpuCas01&) = delete; @@ -47,8 +49,7 @@ public: CpuAction* execution_start(double size, double user_bound) override; CpuAction* execution_start(double size, int requested_cores, double user_bound) override; CpuAction* sleep(double duration) override; - - bool is_used() const override; + void set_factor_cb(const std::function& cb) override; protected: void on_speed_change() override; @@ -58,14 +59,13 @@ protected: * Action * **********/ class CpuCas01Action : public CpuAction { + int requested_core_ = 1; + public: CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint, int requested_core); CpuCas01Action(const CpuCas01Action&) = delete; CpuCas01Action& operator=(const CpuCas01Action&) = delete; - int requested_core() const; - -private: - int requested_core_ = 1; + int requested_core() const { return requested_core_; } }; } // namespace resource