From: Martin Quinson Date: Wed, 9 Oct 2019 15:35:56 +0000 (+0200) Subject: sonar: kill an overriding method X-Git-Tag: v3.24~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9b2d4ca18efb1f97c70620a13bb02965e96651d1 sonar: kill an overriding method --- diff --git a/include/simgrid/s4u/Exec.hpp b/include/simgrid/s4u/Exec.hpp index a3920f7a74..989aa69ab3 100644 --- a/include/simgrid/s4u/Exec.hpp +++ b/include/simgrid/s4u/Exec.hpp @@ -28,7 +28,6 @@ class XBT_PUBLIC Exec : public Activity { double timeout_ = 0.0; std::string tracing_category_ = ""; std::atomic_int_fast32_t refcount_{0}; - Host* host_ = nullptr; protected: Exec(); @@ -89,7 +88,6 @@ public: Exec* start() override; ExecPtr set_host(Host* host) override; - Host* get_host(); double get_remaining() override; double get_remaining_ratio() override; diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index 698c1b1261..828f870a2f 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -105,6 +105,9 @@ ExecPtr Exec::set_name(const std::string& name) return this; } +/** @brief Retrieve the host on which this activity takes place. + * If it runs on more than one host, only the first host is returned. + */ Host* Exec::get_host() const { return static_cast(pimpl_.get())->get_host(); @@ -179,18 +182,10 @@ ExecPtr ExecSeq::set_host(Host* host) "Cannot change the host of an exec once it's done (state: %d)", (int)state_); if (state_ == State::STARTED) boost::static_pointer_cast(pimpl_)->migrate(host); - host_ = host; boost::static_pointer_cast(pimpl_)->set_host(host); return this; } - -/** @brief Retrieve the host on which this activity takes place. */ -Host* ExecSeq::get_host() -{ - return host_; -} - /** @brief Returns the amount of flops that remain to be done */ double ExecSeq::get_remaining() {