Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Declare functions "const" in src/kernel/.
[simgrid.git] / src / kernel / context / Context.hpp
index eb44e76..7dc6420 100644 (file)
@@ -45,19 +45,20 @@ class XBT_PUBLIC Context {
 
   std::function<void()> code_;
   actor::ActorImpl* actor_ = nullptr;
+  bool iwannadie_          = false;
   void declare_context(std::size_t size);
 
 public:
-  bool iwannadie = false;
-
   Context(std::function<void()>&& code, actor::ActorImpl* actor);
   Context(const Context&) = delete;
   Context& operator=(const Context&) = delete;
   virtual ~Context();
 
-  void operator()() { code_(); }
+  bool wannadie() const { return iwannadie_; }
+  void set_wannadie(bool value = true) { iwannadie_ = value; }
+  void operator()() const { code_(); }
   bool has_code() const { return static_cast<bool>(code_); }
-  actor::ActorImpl* get_actor() { return this->actor_; }
+  actor::ActorImpl* get_actor() const { return this->actor_; }
 
   // Scheduling methods
   virtual void stop();
@@ -108,7 +109,4 @@ XBT_PRIVATE void SIMIX_context_mod_exit();
 #ifndef WIN32
 XBT_PUBLIC_DATA unsigned char sigsegv_stack[SIGSTKSZ];
 #endif
-
-XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const std::string& name);
-
 #endif