X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0d08efd41a22b0813a99a3c206152d2edcbf3f00..17288b1b642b369a5377677875d08a82d37a5f67:/src/surf/cpu_cas01.hpp diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index 7d076d4dc9..3855bf4e2f 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -1,8 +1,11 @@ -/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#ifndef SIMGRID_SURF_CPUCAS01_HPP +#define SIMGRID_SURF_CPUCAS01_HPP + #include "cpu_interface.hpp" #include "xbt/base.h" @@ -11,7 +14,8 @@ ***********/ namespace simgrid { -namespace surf { +namespace kernel { +namespace resource { class XBT_PRIVATE CpuCas01Model; class XBT_PRIVATE CpuCas01; @@ -21,12 +25,13 @@ class XBT_PRIVATE CpuCas01Action; * Model * *********/ -class CpuCas01Model : public simgrid::surf::CpuModel { +class CpuCas01Model : public CpuModel { public: - explicit CpuCas01Model(kernel::resource::Model::UpdateAlgo algo); - ~CpuCas01Model() override; + explicit CpuCas01Model(const std::string& name); + CpuCas01Model(const CpuCas01Model&) = delete; + CpuCas01Model& operator=(const CpuCas01Model&) = delete; - Cpu* create_cpu(simgrid::s4u::Host* host, std::vector* speed_per_pstate, int core) override; + Cpu* create_cpu(s4u::Host* host, const std::vector& speed_per_pstate) override; }; /************ @@ -35,14 +40,15 @@ public: class CpuCas01 : public Cpu { public: - CpuCas01(CpuCas01Model* model, simgrid::s4u::Host* host, std::vector* speed_per_pstate, int core); - ~CpuCas01() override; - void apply_event(simgrid::kernel::profile::Event* event, double value) override; + using Cpu::Cpu; + CpuCas01(const CpuCas01&) = delete; + CpuCas01& operator=(const CpuCas01&) = delete; + void apply_event(profile::Event* event, double value) override; CpuAction* execution_start(double size) override; CpuAction* execution_start(double size, int requested_cores) override; CpuAction* sleep(double duration) override; - bool is_used() override; + bool is_used() const override; protected: void on_speed_change() override; @@ -51,20 +57,23 @@ protected: /********** * Action * **********/ -class CpuCas01Action: public CpuAction { - friend CpuAction *CpuCas01::execution_start(double size); - friend CpuAction *CpuCas01::sleep(double duration); +class CpuCas01Action : public CpuAction { + friend CpuAction* CpuCas01::execution_start(double size); + friend CpuAction* CpuCas01::sleep(double duration); + public: - CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed, - kernel::lmm::Constraint* constraint, int core_count); - CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed, - kernel::lmm::Constraint* constraint); - ~CpuCas01Action() override; - int requested_core(); + CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint, + int requested_core = 1); + CpuCas01Action(const CpuCas01Action&) = delete; + CpuCas01Action& operator=(const CpuCas01Action&) = delete; + int requested_core() const; private: int requested_core_ = 1; }; -} -} +} // namespace resource +} // namespace kernel +} // namespace simgrid + +#endif