Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Disable copy for actor::ProcessArg.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 14 Apr 2021 12:21:14 +0000 (14:21 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 14 Apr 2021 19:09:56 +0000 (21:09 +0200)
Also fix sonar issue S5018: Move and swap operations should be "noexcept"

src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp

index 6bd0698..fe224fc 100644 (file)
@@ -355,7 +355,7 @@ s4u::Actor* ActorImpl::restart()
   XBT_DEBUG("Restarting actor %s on %s", get_cname(), host_->get_cname());
 
   // retrieve the arguments of the old actor
-  ProcessArg arg = ProcessArg(host_, this);
+  ProcessArg arg(host_, this);
 
   // kill the old actor
   context::Context::self()->get_actor()->kill(this);
index 657d6ed..6b9d674 100644 (file)
@@ -160,7 +160,9 @@ public:
   /* list of functions executed when the process dies */
   const std::shared_ptr<std::vector<std::function<void(bool)>>> on_exit;
 
-  ProcessArg() = delete;
+  ProcessArg()                  = delete;
+  ProcessArg(const ProcessArg&) = delete;
+  ProcessArg& operator=(const ProcessArg&) = delete;
 
   explicit ProcessArg(const std::string& name, const std::function<void()>& code, void* data, s4u::Host* host,
                       double kill_time, const std::unordered_map<std::string, std::string>& properties,