Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More const pointers.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Nov 2020 13:43:05 +0000 (14:43 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 18 Nov 2020 13:43:05 +0000 (14:43 +0100)
src/mc/ModelChecker.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Host.cpp

index 884444c..4ae8982 100644 (file)
@@ -219,7 +219,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
     if (property_automaton == nullptr)
       property_automaton = xbt_automaton_new();
 
-    RemoteSimulation* process = &this->get_remote_simulation();
+    const RemoteSimulation* process = &this->get_remote_simulation();
     RemotePtr<int> address = remote((int*)message.data);
     xbt::add_proposition(property_automaton, message.name, [process, address]() { return process->read(address); });
 
index 300204b..f9b4272 100644 (file)
@@ -50,7 +50,7 @@ Actor* Actor::self()
 
 ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
       kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
   return actor->get_iface();
@@ -73,7 +73,7 @@ ActorPtr Actor::start(const std::function<void()>& code)
 
 ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::function<void()>& code)
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
       kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
 
@@ -111,7 +111,7 @@ void Actor::join()
 void Actor::join(double timeout)
 {
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
-  kernel::actor::ActorImpl* target = pimpl_;
+  const kernel::actor::ActorImpl* target = pimpl_;
   kernel::actor::simcall_blocking<void>([issuer, target, timeout] {
     if (target->finished_) {
       // The joined process is already finished, just wake up the issuer right away
@@ -252,7 +252,7 @@ double Actor::get_kill_time() const
 
 void Actor::kill()
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::simcall([this, self] { self->kill(pimpl_); });
 }
 
@@ -269,7 +269,7 @@ ActorPtr Actor::by_pid(aid_t pid)
 
 void Actor::kill_all()
 {
-  kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+  const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::simcall([self] { self->kill_all(); });
 }
 
index 4007c4d..68d6efb 100644 (file)
@@ -96,7 +96,7 @@ void Host::turn_on()
 void Host::turn_off()
 {
   if (is_on()) {
-    kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
+    const kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
     kernel::actor::simcall([this, self] {
       for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
         if (vm->get_pm() == this) {