Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use const& for the parameters of type std::string not affected by previous commit.
[simgrid.git] / src / kernel / context / Context.hpp
index 06bd27a..c851241 100644 (file)
@@ -100,15 +100,16 @@ class XBT_PUBLIC StopRequest {
    */
 public:
   StopRequest() = default;
-  explicit StopRequest(std::string msg) : msg_(std::string("Actor killed (") + msg + std::string(").")) {}
+  explicit StopRequest(const std::string& msg) : msg_(std::string("Actor killed (") + msg + std::string(").")) {}
   ~StopRequest();
   const char* what() const noexcept { return msg_.c_str(); }
 
+  static void do_throw();
+  static bool try_n_catch(std::function<void(void)> try_block);
+
 private:
   std::string msg_ = std::string("Actor killed.");
 };
-XBT_PUBLIC void throw_stoprequest();
-XBT_PUBLIC bool try_n_catch_stoprequest(std::function<void(void)> try_block);
 
 /* This allows Java to hijack the context factory (Java induces factories of factory :) */
 typedef ContextFactory* (*ContextFactoryInitializer)();
@@ -140,6 +141,6 @@ XBT_PUBLIC int SIMIX_process_get_maxpid();
 
 XBT_PRIVATE void SIMIX_post_create_environment();
 
-XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(std::string name);
+XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const std::string& name);
 
 #endif