Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use 'using-declarations' to inherit constructors.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Nov 2020 22:15:52 +0000 (23:15 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Nov 2020 22:35:17 +0000 (23:35 +0100)
include/simgrid/Exception.hpp
include/simgrid/smpi/replay.hpp
include/xbt/random.hpp
src/kernel/lmm/maxmin.hpp
src/mc/inspect/DwarfExpression.hpp
src/plugins/host_dvfs.cpp
src/surf/cpu_interface.hpp
src/surf/network_cm02.hpp
src/surf/network_interface.hpp

index a030f0b..fb9c42e 100644 (file)
@@ -60,19 +60,19 @@ public:
 
 class XBT_PUBLIC ImpossibleError : public std::logic_error {
 public:
-  explicit ImpossibleError(const std::string& arg) : std::logic_error(arg) {}
+  using std::logic_error::logic_error;
   ~ImpossibleError() override;
 };
 
 class XBT_PUBLIC InitializationError : public std::logic_error {
 public:
-  explicit InitializationError(const std::string& arg) : std::logic_error(arg) {}
+  using std::logic_error::logic_error;
   ~InitializationError() override;
 };
 
 class XBT_PUBLIC UnimplementedError : public std::logic_error {
 public:
-  explicit UnimplementedError(const std::string& arg) : std::logic_error(arg) {}
+  using std::logic_error::logic_error;
   ~UnimplementedError() override;
 };
 
index 4da7a7e..4b27c49 100644 (file)
@@ -312,13 +312,13 @@ public:
 
 class GatherAction : public ReplayAction<GatherArgParser> {
 public:
-  explicit GatherAction(const std::string& name) : ReplayAction(name) {}
+  using ReplayAction::ReplayAction;
   void kernel(xbt::ReplayAction& action) override;
 };
 
 class GatherVAction : public ReplayAction<GatherVArgParser> {
 public:
-  explicit GatherVAction(const std::string& name) : ReplayAction(name) {}
+  using ReplayAction::ReplayAction;
   void kernel(xbt::ReplayAction& action) override;
 };
 
index 7d4e4ef..b8a2474 100644 (file)
@@ -85,8 +85,7 @@ public:
  */
 class XBT_PUBLIC StdRandom : public Random {
 public:
-  StdRandom() = default;
-  explicit StdRandom(int seed) : Random(seed) {}
+  using Random::Random;
 
   int uniform_int(int min, int max) override;
   double uniform_real(double min, double max) override;
@@ -100,8 +99,7 @@ public:
  */
 class XBT_PUBLIC XbtRandom : public Random {
 public:
-  XbtRandom() = default;
-  explicit XbtRandom(int seed) : Random(seed) {}
+  using Random::Random;
 
   int uniform_int(int min, int max) override;
   double uniform_real(double min, double max) override;
index f525dfa..5fd3827 100644 (file)
@@ -553,7 +553,7 @@ private:
 
 class XBT_PUBLIC FairBottleneck : public System {
 public:
-  explicit FairBottleneck(bool selective_update) : System(selective_update) {}
+  using System::System;
   void solve() final { bottleneck_solve(); }
 
 private:
index c6258b3..3a94b47 100644 (file)
@@ -53,7 +53,7 @@ struct ExpressionContext {
 /** When an error happens in the execution of a DWARF expression */
 class evaluation_error : public std::runtime_error {
 public:
-  explicit evaluation_error(const char* what) : std::runtime_error(what) {}
+  using std::runtime_error::runtime_error;
 };
 
 /** A stack for evaluating a DWARF expression
index 82c38aa..57bf368 100644 (file)
@@ -140,7 +140,7 @@ public:
  */
 class Performance : public Governor {
 public:
-  explicit Performance(simgrid::s4u::Host* ptr) : Governor(ptr) {}
+  using Governor::Governor;
   std::string get_name() const override { return "Performance"; }
 
   void update() override { get_host()->set_pstate(get_min_pstate()); }
@@ -158,7 +158,7 @@ public:
  */
 class Powersave : public Governor {
 public:
-  explicit Powersave(simgrid::s4u::Host* ptr) : Governor(ptr) {}
+  using Governor::Governor;
   std::string get_name() const override { return "Powersave"; }
 
   void update() override { get_host()->set_pstate(get_max_pstate()); }
@@ -181,7 +181,7 @@ class OnDemand : public Governor {
   double freq_up_threshold_ = 0.80;
 
 public:
-  explicit OnDemand(simgrid::s4u::Host* ptr) : Governor(ptr) {}
+  using Governor::Governor;
   std::string get_name() const override { return "OnDemand"; }
 
   void update() override
@@ -229,7 +229,7 @@ class Conservative : public Governor {
   double freq_down_threshold_ = .2;
 
 public:
-  explicit Conservative(simgrid::s4u::Host* ptr) : Governor(ptr) {}
+  using Governor::Governor;
   std::string get_name() const override { return "Conservative"; }
 
   void update() override
index 0215897..4ac9b2f 100644 (file)
@@ -27,7 +27,7 @@ namespace resource {
  */
 class XBT_PUBLIC CpuModel : public Model {
 public:
-  explicit CpuModel(Model::UpdateAlgo algo) : Model(algo) {}
+  using Model::Model;
 
   /**
    * @brief Create a Cpu
@@ -176,8 +176,7 @@ public:
    */
   static xbt::signal<void(CpuAction const&, Action::State)> on_state_change;
 
-  CpuAction(Model* model, double cost, bool failed) : Action(model, cost, failed) {}
-  CpuAction(Model* model, double cost, bool failed, lmm::Variable* var) : Action(model, cost, failed, var) {}
+  using Action::Action;
 
   void set_state(Action::State state) override;
 
index 42354ab..e5b1e63 100644 (file)
@@ -60,8 +60,7 @@ class NetworkCm02Action : public NetworkAction {
   friend Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate);
 
 public:
-  NetworkCm02Action(Model* model, s4u::Host& src, s4u::Host& dst, double cost, bool failed)
-      : NetworkAction(model, src, dst, cost, failed){};
+  using NetworkAction::NetworkAction;
   ~NetworkCm02Action() override = default;
   void update_remains_lazy(double now) override;
 };
index 9fffd5b..5ff4cf2 100644 (file)
@@ -35,7 +35,7 @@ public:
   static config::Flag<double> cfg_tcp_gamma;
   static config::Flag<bool> cfg_crosstraffic;
 
-  explicit NetworkModel(Model::UpdateAlgo algo) : Model(algo) {}
+  using Model::Model;
   NetworkModel(const NetworkModel&) = delete;
   NetworkModel& operator=(const NetworkModel&) = delete;
   ~NetworkModel() override;