From 153259d001d7e03ebc06ea7dc27803788a9cdb9d Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 20 Dec 2015 19:06:04 +0100 Subject: [PATCH] add some missing 'override' markers in the surf::Host hierarchy --- src/surf/host_clm03.hpp | 14 +++---- src/surf/host_interface.hpp | 7 ++-- src/surf/host_ptask_L07.hpp | 73 ++++++++++++++++++------------------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/surf/host_clm03.hpp b/src/surf/host_clm03.hpp index 3744da090f..460cacba6a 100644 --- a/src/surf/host_clm03.hpp +++ b/src/surf/host_clm03.hpp @@ -36,13 +36,13 @@ public: Host *createHost(const char *name, RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override; double shareResources(double now) override; - void updateActionsState(double now, double delta); + void updateActionsState(double now, double delta) override; Action *executeParallelTask(int host_nb, sg_host_t *host_list, double *flops_amount, double *bytes_amount, - double rate); + double rate) override; }; /************ @@ -53,13 +53,13 @@ class HostCLM03 : public Host { public: HostCLM03(HostModel *model, const char* name, xbt_dict_t properties, xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu); ~HostCLM03(); - void updateState(tmgr_trace_event_t event_type, double value, double date); + void updateState(tmgr_trace_event_t event_type, double value, double date) override; - virtual Action *execute(double size); - virtual Action *sleep(double duration); - e_surf_resource_state_t getState(); + virtual Action *execute(double size) override; + virtual Action *sleep(double duration) override; + e_surf_resource_state_t getState() override; - bool isUsed(); + bool isUsed() override; xbt_dynar_t getVms(); }; diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 2aa6669d92..8fde63d95d 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -76,7 +76,7 @@ public: ~HostModel() {} virtual Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu, xbt_dict_t props)=0; - void addTraces(){DIE_IMPOSSIBLE;} + void addTraces() override {DIE_IMPOSSIBLE;} virtual void adjustWeightOfDummyCpuActions(); virtual Action *executeParallelTask(int host_nb, @@ -85,7 +85,7 @@ public: double *bytes_amount, double rate)=0; - bool shareResourcesIsIdempotent() {return true;} + bool shareResourcesIsIdempotent() override {return true;} }; /************ @@ -95,7 +95,8 @@ public: * @brief SURF Host interface class * @details An host represents a machine with a aggregation of a Cpu, a Link and a Storage */ -class Host : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder { +class Host : public simgrid::surf::Resource, + public simgrid::surf::PropertyHolder { public: static simgrid::xbt::Extension EXTENSION_ID; static void init(); diff --git a/src/surf/host_ptask_L07.hpp b/src/surf/host_ptask_L07.hpp index 7bc5f09010..69b9e5afd1 100644 --- a/src/surf/host_ptask_L07.hpp +++ b/src/surf/host_ptask_L07.hpp @@ -43,7 +43,7 @@ public: HostL07Model(); ~HostL07Model(); - double shareResources(double now); + double shareResources(double now) override; void updateActionsState(double now, double delta); Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override; Action *executeParallelTask(int host_nb, @@ -52,19 +52,20 @@ public: double *bytes_amount, double rate) override; xbt_dynar_t getRoute(Host *src, Host *dst); - void addTraces(); + void addTraces() override; }; class CpuL07Model : public CpuModel { public: CpuL07Model(HostL07Model *hmodel) : CpuModel() {p_hostModel = hmodel;}; ~CpuL07Model() {surf_cpu_model_pm = NULL;}; + Cpu *createCpu(const char *name, xbt_dynar_t speedPeak, int pstate, double speedScale, tmgr_trace_t speedTrace, int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace) override; - void addTraces() {DIE_IMPOSSIBLE;}; + void addTraces() override {DIE_IMPOSSIBLE;}; HostL07Model *p_hostModel; }; @@ -83,9 +84,9 @@ public: e_surf_link_sharing_policy_t policy, xbt_dict_t properties) override; - Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate); - void addTraces() {DIE_IMPOSSIBLE;}; - bool shareResourcesIsIdempotent() {return true;} + Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate) override; + void addTraces() override {DIE_IMPOSSIBLE;}; + bool shareResourcesIsIdempotent() override {return true;} HostL07Model *p_hostModel; }; @@ -98,11 +99,11 @@ class HostL07 : public Host { public: HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu); ~HostL07(); - bool isUsed() {DIE_IMPOSSIBLE;}; - void updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, double /*date*/) {DIE_IMPOSSIBLE;}; - Action *execute(double size) {return p_cpu->execute(size);}; - Action *sleep(double duration) {return p_cpu->sleep(duration);}; - e_surf_resource_state_t getState(); + bool isUsed() override {DIE_IMPOSSIBLE;}; + void updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, double /*date*/) override {DIE_IMPOSSIBLE;}; + Action *execute(double size) override {return p_cpu->execute(size);}; + Action *sleep(double duration) override {return p_cpu->sleep(duration);}; + e_surf_resource_state_t getState() override; }; class CpuL07 : public Cpu { @@ -114,17 +115,16 @@ public: double power_scale, double power_initial, tmgr_trace_t power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); ~CpuL07(); - bool isUsed(); - void updateState(tmgr_trace_event_t event_type, double value, double date); - Action *execute(double size); - Action *sleep(double duration); - - double getCurrentPowerPeak() {THROW_UNIMPLEMENTED;}; - double getPowerPeakAt(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; - int getNbPstates() {THROW_UNIMPLEMENTED;}; - void setPstate(int /*pstate_index*/) {THROW_UNIMPLEMENTED;}; - int getPstate() {THROW_UNIMPLEMENTED;}; - double getConsumedEnergy() {THROW_UNIMPLEMENTED;}; + bool isUsed() override; + void updateState(tmgr_trace_event_t event_type, double value, double date) override; + Action *execute(double size) override; + Action *sleep(double duration) override; + + double getCurrentPowerPeak() override {THROW_UNIMPLEMENTED;}; + double getPowerPeakAt(int /*pstate_index*/) override {THROW_UNIMPLEMENTED;}; + int getNbPstates() override {THROW_UNIMPLEMENTED;}; + void setPstate(int /*pstate_index*/) override {THROW_UNIMPLEMENTED;}; + int getPstate() override {THROW_UNIMPLEMENTED;}; }; class LinkL07 : public Link { @@ -138,13 +138,12 @@ public: state_initial, tmgr_trace_t state_trace, e_surf_link_sharing_policy_t policy); - ~LinkL07(){ - }; - bool isUsed(); - void updateState(tmgr_trace_event_t event_type, double value, double date); - double getBandwidth(); - void updateBandwidth(double value, double date=surf_get_clock()); - void updateLatency(double value, double date=surf_get_clock()); + ~LinkL07(){ }; + bool isUsed() override; + void updateState(tmgr_trace_event_t event_type, double value, double date) override; + double getBandwidth() override; + void updateBandwidth(double value, double date=surf_get_clock()) override; + void updateLatency(double value, double date=surf_get_clock()) override; double m_bwCurrent; tmgr_trace_event_t p_bwEvent; @@ -168,14 +167,14 @@ public: void updateBound(); - int unref(); - void cancel(); - void suspend(); - void resume(); - bool isSuspended(); - void setMaxDuration(double duration); - void setPriority(double priority); - double getRemains(); + int unref() override; + void cancel() override; + void suspend() override; + void resume() override; + bool isSuspended() override; + void setMaxDuration(double duration) override; + void setPriority(double priority) override; + double getRemains() override; std::vector * p_edgeList = new std::vector(); double *p_computationAmount; -- 2.20.1