Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add some missing 'override' markers in the surf::Host hierarchy
[simgrid.git] / src / surf / host_ptask_L07.hpp
index 2bdcb97..69b9e5a 100644 (file)
@@ -4,6 +4,10 @@
 /* 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. */
 
+#include <cstdlib>
+
+#include <vector>
+
 #include <xbt/base.h>
 
 #include "host_interface.hpp"
@@ -11,6 +15,9 @@
 #ifndef HOST_L07_HPP_
 #define HOST_L07_HPP_
 
+namespace simgrid {
+namespace surf {
+
 /***********
  * Classes *
  ***********/
@@ -36,30 +43,29 @@ 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);
+  Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override;
   Action *executeParallelTask(int host_nb,
                               sg_host_t *host_list,
                                                          double *flops_amount,
                                                          double *bytes_amount,
-                                                         double rate);
+                                                         double rate) override;
   xbt_dynar_t getRoute(Host *src, Host *dst);
-  void addTraces();
-  NetworkModel *p_networkModel;
+  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 powerPeak,
-                          int pstate, double power_scale,
-                          tmgr_trace_t power_trace, int core,
+
+  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,
-                          xbt_dict_t cpu_properties);
-  void addTraces() {DIE_IMPOSSIBLE;};
+                          tmgr_trace_t state_trace) override;
+  void addTraces() override {DIE_IMPOSSIBLE;};
 
   HostL07Model *p_hostModel;
 };
@@ -69,19 +75,18 @@ public:
   NetworkL07Model(HostL07Model *hmodel) : NetworkModel() {p_hostModel = hmodel;};
   ~NetworkL07Model() {surf_network_model = NULL;};
   Link* createLink(const char *name,
-                                                  double bw_initial,
-                                                  tmgr_trace_t bw_trace,
-                                                  double lat_initial,
-                                                  tmgr_trace_t lat_trace,
-                                                  e_surf_resource_state_t
-                                                  state_initial,
-                                                  tmgr_trace_t state_trace,
-                                                  e_surf_link_sharing_policy_t
-                                                  policy, xbt_dict_t properties);
-
-  Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
-  void addTraces() {DIE_IMPOSSIBLE;};
-  bool shareResourcesIsIdempotent() {return true;}
+                 double bw_initial,
+                 tmgr_trace_t bw_trace,
+                 double lat_initial,
+                 tmgr_trace_t lat_trace,
+                 e_surf_resource_state_t state_initial,
+                 tmgr_trace_t state_trace,
+                 e_surf_link_sharing_policy_t policy,
+                 xbt_dict_t properties) override;
+
+  Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate) override;
+  void addTraces() override {DIE_IMPOSSIBLE;};
+  bool shareResourcesIsIdempotent() override {return true;}
 
   HostL07Model *p_hostModel;
 };
@@ -93,32 +98,33 @@ public:
 class HostL07 : public Host {
 public:
   HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu);
-  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();
+  ~HostL07();
+  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 {
   friend void HostL07Model::addTraces();
   tmgr_trace_event_t p_stateEvent;
-  tmgr_trace_event_t p_powerEvent;
+  tmgr_trace_event_t p_speedEvent;
 public:
-  CpuL07(CpuL07Model *model, const char* name, xbt_dict_t properties,
+  CpuL07(CpuL07Model *model, const char* name,
                 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);
-  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;};
+  ~CpuL07();
+  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 {
@@ -132,17 +138,13 @@ 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();
-  double getLatency();
-  void updateBandwidth(double value, double date=surf_get_clock());
-  void updateLatency(double value, double date=surf_get_clock());
-
-  double m_latCurrent;
-  tmgr_trace_event_t p_latEvent;
+  ~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;
 };
@@ -165,20 +167,23 @@ 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;
 
-  vector<RoutingEdge*> * p_edgeList = new vector<RoutingEdge*>();
+  std::vector<RoutingEdge*> * p_edgeList = new std::vector<RoutingEdge*>();
   double *p_computationAmount;
   double *p_communicationAmount;
   double m_latency;
   double m_rate;
 };
 
+}
+}
+
 #endif /* HOST_L07_HPP_ */