Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pass std::string parameters by reference too.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 10 Mar 2019 22:20:43 +0000 (23:20 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 11 Mar 2019 08:19:33 +0000 (09:19 +0100)
88 files changed:
examples/s4u/actor-create/s4u-actor-create.cpp
examples/s4u/platform-properties/s4u-platform-properties.cpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
include/simgrid/kernel/resource/Action.hpp
include/simgrid/kernel/routing/ClusterZone.hpp
include/simgrid/kernel/routing/DijkstraZone.hpp
include/simgrid/kernel/routing/DragonflyZone.hpp
include/simgrid/kernel/routing/EmptyZone.hpp
include/simgrid/kernel/routing/FatTreeZone.hpp
include/simgrid/kernel/routing/FloydZone.hpp
include/simgrid/kernel/routing/FullZone.hpp
include/simgrid/kernel/routing/NetPoint.hpp
include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/kernel/routing/RoutedZone.hpp
include/simgrid/kernel/routing/TorusZone.hpp
include/simgrid/kernel/routing/VivaldiZone.hpp
include/simgrid/plugins/file_system.h
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Engine.hpp
include/simgrid/s4u/Exec.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Link.hpp
include/simgrid/s4u/Mailbox.hpp
include/simgrid/s4u/NetZone.hpp
include/simgrid/s4u/Storage.hpp
include/simgrid/s4u/VirtualMachine.hpp
include/simgrid/simix.hpp
include/simgrid/smpi/replay.hpp
include/xbt/config.hpp
include/xbt/file.hpp
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_containers.hpp
src/instr/instr_paje_events.hpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_types.hpp
src/instr/instr_paje_values.cpp
src/instr/instr_paje_values.hpp
src/instr/instr_private.hpp
src/instr/instr_smpi.hpp
src/instr/jedule/jedule_events.cpp
src/instr/jedule/jedule_platform.cpp
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/IoImpl.cpp
src/kernel/activity/IoImpl.hpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/SleepImpl.hpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetPoint.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/mc/mc_record.cpp
src/mc/mc_record.hpp
src/msg/msg_private.hpp
src/msg/msg_task.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/host_dvfs.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Link.cpp
src/s4u/s4u_Netzone.cpp
src/s4u/s4u_Storage.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_deployment.cpp
src/surf/PropertyHolder.cpp
src/surf/PropertyHolder.hpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
src/surf/xml/platf_private.hpp
src/xbt/config.cpp
teshsuite/s4u/cloud-sharing/cloud-sharing.cpp

index c8eb088..43cd620 100644 (file)
@@ -27,7 +27,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_actor_create, "The logging channel used in this
  *
  * Later, this actor class is instantiated within the simulation.
  */
-static void receiver(std::string mailbox_name)
+static void receiver(const std::string& mailbox_name)
 {
   simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name);
 
@@ -65,7 +65,7 @@ public:
   std::string mbox  = "mb42";
   std::string msg = "GaBuZoMeu";
   explicit Sender() = default; /* Sending the default message */
-  explicit Sender(std::string arg) : msg(arg) { /* Sending the specified message */}
+  explicit Sender(const std::string& arg) : msg(arg) { /* Sending the specified message */}
   explicit Sender(std::vector<std::string> args)
   {
     /* This constructor is used when we start the actor from the deployment file */
index 79b79a4..fe49596 100644 (file)
@@ -11,7 +11,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Property test");
 
-static void test_host(std::string hostname)
+static void test_host(const std::string& hostname)
 {
   simgrid::s4u::Host* thehost = simgrid::s4u::Host::by_name(hostname);
   std::unordered_map<std::string, std::string>* props = thehost->get_properties();
index 21e4aa9..3e96e66 100644 (file)
@@ -19,7 +19,7 @@ namespace jedule{
 
 class XBT_PUBLIC Event {
 public:
-  Event(std::string name, double start_time, double end_time, std::string type);
+  Event(const std::string& name, double start_time, double end_time, const std::string& type);
   Event(const Event&) = delete;
   Event& operator=(const Event&) = delete;
   ~Event();
index 0d8cf5c..1c026df 100644 (file)
@@ -17,7 +17,7 @@ namespace simgrid {
 namespace jedule{
 class XBT_PUBLIC Container {
 public:
-  explicit Container(std::string name);
+  explicit Container(const std::string& name);
   Container(const Container&) = delete;
   Container& operator=(const Container&) = delete;
   virtual ~Container();
index 0acd6b5..ca85918 100644 (file)
@@ -182,7 +182,7 @@ public:
   /** @brief Get the tracing category associated to the current action */
   const std::string& get_category() const { return category_; }
   /** @brief Set the tracing category of the current Action */
-  void set_category(std::string category) { category_ = std::move(category); }
+  void set_category(const std::string& category) { category_ = category; }
 
   /** @brief Get the priority of the current Action */
   double get_priority() const { return sharing_priority_; };
index 69c252f..e342aca 100644 (file)
@@ -67,7 +67,7 @@ namespace routing {
 
 class ClusterZone : public NetZoneImpl {
 public:
-  explicit ClusterZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit ClusterZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
index 3ae74ff..279bf5c 100644 (file)
@@ -24,7 +24,7 @@ namespace routing {
  */
 class XBT_PRIVATE DijkstraZone : public RoutedZone {
 public:
-  DijkstraZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel, bool cached);
+  DijkstraZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel, bool cached);
   DijkstraZone(const DijkstraZone&) = delete;
   DijkstraZone& operator=(const DijkstraZone&) = delete;
 
index f1c16f4..f805299 100644 (file)
@@ -63,7 +63,7 @@ public:
  */
 class XBT_PUBLIC DragonflyZone : public ClusterZone {
 public:
-  explicit DragonflyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   DragonflyZone(const DragonflyZone&) = delete;
   DragonflyZone& operator=(const DragonflyZone&) = delete;
   ~DragonflyZone() override;
@@ -77,7 +77,7 @@ public:
 private:
   void generate_routers();
   void generate_links();
-  void create_link(std::string id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
+  void create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown);
 
   simgrid::s4u::Link::SharingPolicy sharing_policy_;
   double bw_  = 0;
index 0a8641d..63a62ff 100644 (file)
@@ -21,7 +21,7 @@ namespace routing {
 
 class XBT_PRIVATE EmptyZone : public NetZoneImpl {
 public:
-  explicit EmptyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit EmptyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   ~EmptyZone() override;
 
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override
index 9539888..0e69e0d 100644 (file)
@@ -98,7 +98,7 @@ public:
  */
 class XBT_PRIVATE FatTreeZone : public ClusterZone {
 public:
-  explicit FatTreeZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit FatTreeZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   FatTreeZone(const FatTreeZone&) = delete;
   FatTreeZone& operator=(const FatTreeZone&) = delete;
   ~FatTreeZone() override;
index 6bebe5c..b16ea00 100644 (file)
@@ -23,7 +23,7 @@ namespace routing {
  */
 class XBT_PRIVATE FloydZone : public RoutedZone {
 public:
-  explicit FloydZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit FloydZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   FloydZone(const FloydZone&) = delete;
   FloydZone& operator=(const FloydZone&) = delete;
   ~FloydZone() override;
index 2cf77e7..d15c74e 100644 (file)
@@ -20,7 +20,7 @@ namespace routing {
  */
 class XBT_PRIVATE FullZone : public RoutedZone {
 public:
-  explicit FullZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit FullZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   FullZone(const FullZone&) = delete;
   FullZone& operator=(const FullZone) = delete;
   ~FullZone() override;
index 7a49f91..7984766 100644 (file)
@@ -26,7 +26,7 @@ class NetPoint : public simgrid::xbt::Extendable<NetPoint> {
 public:
   enum class Type { Host, Router, NetZone };
 
-  NetPoint(std::string name, NetPoint::Type component_type, NetZoneImpl* netzone_p);
+  NetPoint(const std::string& name, NetPoint::Type component_type, NetZoneImpl* netzone_p);
   ~NetPoint() = default;
 
   // Our rank in the vertices_ array of the netzone that contains us.
index b8720fa..21a2788 100644 (file)
@@ -51,7 +51,7 @@ class XBT_PUBLIC NetZoneImpl {
   friend simgrid::kernel::EngineImpl; // it destroys netRoot_
 
 protected:
-  explicit NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model);
+  explicit NetZoneImpl(NetZoneImpl* father, const std::string& name, resource::NetworkModel* network_model);
   NetZoneImpl(const NetZoneImpl&) = delete;
   NetZoneImpl& operator=(const NetZoneImpl&) = delete;
   virtual ~NetZoneImpl();
index 57a3fc5..2ecdbfc 100644 (file)
@@ -50,7 +50,7 @@ namespace routing {
 
 class XBT_PRIVATE RoutedZone : public NetZoneImpl {
 public:
-  explicit RoutedZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit RoutedZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
 
   void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
                  std::map<std::string, xbt_edge_t>* edges) override;
index bd88b68..3868b2f 100644 (file)
@@ -21,7 +21,7 @@ namespace routing {
 
 class XBT_PRIVATE TorusZone : public ClusterZone {
 public:
-  explicit TorusZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit TorusZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
   void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) override;
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
index ca22075..22c14e8 100644 (file)
@@ -46,7 +46,7 @@ namespace routing {
 
 class XBT_PRIVATE VivaldiZone : public ClusterZone {
 public:
-  explicit VivaldiZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel);
+  explicit VivaldiZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
 
   void set_peer_link(NetPoint* netpoint, double bw_in, double bw_out, const std::string& coord);
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
index 7538d38..5661719 100644 (file)
@@ -88,8 +88,8 @@ namespace s4u {
  */
 class XBT_PUBLIC File {
 public:
-  File(std::string fullpath, void* userdata);
-  File(std::string fullpath, sg_host_t host, void* userdata);
+  File(const std::string& fullpath, void* userdata);
+  File(const std::string& fullpath, sg_host_t host, void* userdata);
   File(const File&) = delete;
   File& operator=(const File&) = delete;
   ~File();
index 8ecbe54..cd957d8 100644 (file)
@@ -168,17 +168,17 @@ public:
    *
    *  If the actor is restarted, the actor has a fresh copy of the function.
    */
-  static ActorPtr create(std::string name, s4u::Host* host, const std::function<void()>& code);
-  static ActorPtr init(std::string name, s4u::Host* host);
+  static ActorPtr create(const std::string& name, s4u::Host* host, const std::function<void()>& code);
+  static ActorPtr init(const std::string& name, s4u::Host* host);
   ActorPtr start(const std::function<void()>& code);
 
   /** Create an actor from a std::function
    *
    *  If the actor is restarted, the actor has a fresh copy of the function.
    */
-  template <class F> static ActorPtr create(std::string name, s4u::Host* host, F code)
+  template <class F> static ActorPtr create(const std::string& name, s4u::Host* host, F code)
   {
-    return create(std::move(name), host, std::function<void()>(std::move(code)));
+    return create(name, host, std::function<void()>(std::move(code)));
   }
 
   /** Create an actor using a callable thing and its arguments.
@@ -187,13 +187,14 @@ public:
   template <class F, class... Args,
             // This constructor is enabled only if the call code(args...) is valid:
             typename = typename std::result_of<F(Args...)>::type>
-  static ActorPtr create(std::string name, s4u::Host* host, F code, Args... args)
+  static ActorPtr create(const std::string& name, s4u::Host* host, F code, Args... args)
   {
-    return create(std::move(name), host, std::bind(std::move(code), std::move(args)...));
+    return create(name, host, std::bind(std::move(code), std::move(args)...));
   }
 
   // Create actor from function name:
-  static ActorPtr create(std::string name, s4u::Host* host, const std::string& function, std::vector<std::string> args);
+  static ActorPtr create(const std::string& name, s4u::Host* host, const std::string& function,
+                         std::vector<std::string> args);
 
   // ***** Methods *****
   /** This actor will be automatically terminated when the last non-daemon actor finishes **/
@@ -292,7 +293,7 @@ public:
   std::unordered_map<std::string, std::string>*
   get_properties(); // FIXME: do not export the map, but only the keys or something
   const char* get_property(const std::string& key);
-  void set_property(const std::string& key, std::string value);
+  void set_property(const std::string& key, const std::string& value);
 
 #ifndef DOXYGEN
   XBT_ATTRIB_DEPRECATED_v325("Please use Actor::on_exit(fun) instead") void on_exit(
index e96e696..37151a5 100644 (file)
@@ -152,7 +152,7 @@ public:
    * Example:
    * e->set_config("host/model:ptask_L07");
    */
-  void set_config(std::string str);
+  void set_config(const std::string& str);
 
 private:
   simgrid::kernel::EngineImpl* const pimpl;
@@ -162,12 +162,12 @@ private:
 #ifndef DOXYGEN
 public:
   /** @deprecated See Engine::load_platform() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_platform()") void loadPlatform(std::string platf)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_platform()") void loadPlatform(const std::string& platf)
   {
     load_platform(platf);
   }
   /** @deprecated See Engine::register_function() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_function()") void registerFunction(std::string name,
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_function()") void registerFunction(const std::string& name,
                                                                                              int (*code)(int, char**))
   {
     register_function(name, code);
@@ -179,42 +179,44 @@ public:
   }
   /** @deprecated See Engine::register_actor() */
   template <class F>
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(std::string name)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(const std::string& name)
   {
     register_actor<F>(name);
   }
   /** @deprecated See Engine::register_actor() */
   template <class F>
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(std::string name, F code)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(const std::string& name,
+                                                                                          F code)
   {
     register_actor<F>(name, code);
   }
 
   /** @deprecated See Engine::load_deployment() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_deployment()") void loadDeployment(std::string deploy)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_deployment()") void loadDeployment(const std::string& deploy)
   {
     load_deployment(deploy);
   }
   /** @deprecated See Engine::host_by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name()") simgrid::s4u::Host* hostByName(std::string name)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name()") simgrid::s4u::Host* hostByName(
+      const std::string& name)
   {
     return host_by_name(name);
   }
   /** @deprecated See Engine::host_by_name_or_null() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name_or_null()") simgrid::s4u::Host* hostByNameOrNull(
-      std::string name)
+      const std::string& name)
   {
     return host_by_name_or_null(name);
   }
   /** @deprecated See Engine::storage_by_name() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name()") simgrid::s4u::Storage* storageByName(
-      std::string name)
+      const std::string& name)
   {
     return storage_by_name(name);
   }
   /** @deprecated See Engine::storage_by_name_or_null() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name_or_null()") simgrid::s4u::Storage* storageByNameOrNull(
-      std::string name)
+      const std::string& name)
   {
     return storage_by_name_or_null(name);
   }
@@ -244,7 +246,8 @@ public:
   XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_netpoints()") void getNetpointList(
       std::vector<simgrid::kernel::routing::NetPoint*>* list);
   /** @deprecated See Engine::netpoint_by_name_or_null() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netpoint_by_name_or_null()") simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(std::string name)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netpoint_by_name_or_null()")
+      simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(const std::string& name)
   {
     return netpoint_by_name_or_null(name);
   }
@@ -254,8 +257,8 @@ public:
     return get_netzone_root();
   }
   /** @deprecated See Engine::netzone_by_name_or_null() */
-  XBT_ATTRIB_DEPRECATED_v323(
-      "Please use Engine::netzone_by_name_or_null()") simgrid::s4u::NetZone* getNetzoneByNameOrNull(std::string name)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netzone_by_name_or_null()")
+      simgrid::s4u::NetZone* getNetzoneByNameOrNull(const std::string& name)
   {
     return netzone_by_name_or_null(name);
   }
@@ -278,7 +281,10 @@ public:
     return is_initialized();
   }
   /** @deprecated See Engine::set_config() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::set_config()") void setConfig(std::string str) { set_config(str); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::set_config()") void setConfig(const std::string& str)
+  {
+    set_config(str);
+  }
 #endif
 };
 
index 287eaa0..6ec7fab 100644 (file)
@@ -55,9 +55,9 @@ public:
   bool test() override;
 
   ExecPtr set_bound(double bound);
-  ExecPtr set_name(std::string name);
+  ExecPtr set_name(const std::string& name);
   ExecPtr set_priority(double priority);
-  ExecPtr set_tracing_category(std::string category);
+  ExecPtr set_tracing_category(const std::string& category);
   ExecPtr set_timeout(double timeout);
   Exec* cancel() override;
 
index 59ab43c..ffe5016 100644 (file)
@@ -40,7 +40,7 @@ class XBT_PUBLIC Host : public simgrid::xbt::Extendable<Host> {
   friend simgrid::vm::VirtualMachineImpl; // creates the the pimpl_cpu
 
 public:
-  explicit Host(std::string name);
+  explicit Host(const std::string& name);
 
   /** Host destruction logic */
 protected:
@@ -98,7 +98,7 @@ public:
   XBT_ATTRIB_DEPRECATED_v325("Please use !is_on()") bool is_off() const { return not is_on(); }
 
   const char* get_property(const std::string& key) const;
-  void set_property(const std::string& key, std::string value);
+  void set_property(const std::string& key, const std::string& value);
   std::unordered_map<std::string, std::string>* get_properties();
 
   void set_state_profile(kernel::profile::Profile* p);
@@ -195,7 +195,8 @@ public:
     return get_property(key);
   }
   /** @deprecated See Host::set_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_property()") void setProperty(std::string key, std::string value)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_property()") void setProperty(const std::string& key,
+                                                                                 const std::string& value)
   {
     set_property(key, value);
   }
index d72b0b9..84fffeb 100644 (file)
@@ -94,7 +94,7 @@ public:
   void set_latency_profile(kernel::profile::Profile* profile);
 
   const char* get_property(const std::string& key);
-  void set_property(const std::string& key, std::string value);
+  void set_property(const std::string& key, const std::string& value);
 
   /* The signals */
   /** @brief Callback signal fired when a new Link is created */
@@ -143,7 +143,11 @@ public:
   /** @deprecated */
   XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_property()") const char* getProperty(const char* key) {return get_property(key);}
   /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_property()") void setProperty(std::string key, std::string value) {set_property(key, value);}
+  XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_property()") void setProperty(const std::string& key,
+                                                                                 const std::string& value)
+  {
+    set_property(key, value);
+  }
 
   /** @deprecated */
   XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_data()") void* getData() {return get_data();}
index c009267..5be4b24 100644 (file)
@@ -125,7 +125,7 @@ public:
     return by_name(name);
   }
   /** @deprecated Mailbox::by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::by_name()") static MailboxPtr byName(std::string name)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::by_name()") static MailboxPtr byName(const std::string& name)
   {
     return by_name(name);
   }
index db5854b..5329cf4 100644 (file)
@@ -55,7 +55,7 @@ public:
 
   /** Retrieve the property value (or nullptr if not set) */
   const char* get_property(const std::string& key);
-  void set_property(const std::string& key, std::string value);
+  void set_property(const std::string& key, const std::string& value);
 
   /* Add content to the netzone, at parsing time. It should be sealed afterward. */
   int add_component(kernel::routing::NetPoint* elm); /* A host, a router or a netzone, whatever */
index f205ab5..767a8ac 100644 (file)
@@ -31,7 +31,7 @@ class XBT_PUBLIC Storage : public simgrid::xbt::Extendable<Storage> {
   friend simgrid::surf::StorageImpl;
 
 public:
-  explicit Storage(std::string name, surf::StorageImpl * pimpl);
+  explicit Storage(const std::string& name, surf::StorageImpl* pimpl);
 
 protected:
   virtual ~Storage() = default;
@@ -58,7 +58,7 @@ public:
 
   std::unordered_map<std::string, std::string>* get_properties();
   const char* get_property(const std::string& key);
-  void set_property(const std::string&, std::string value);
+  void set_property(const std::string&, const std::string& value);
 
   void set_data(void* data) { userdata_ = data; }
   void* get_data() { return userdata_; }
@@ -75,7 +75,7 @@ public:
   // Deprecated functions
 #ifndef DOXYGEN
   /** @deprecated Storage::by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::by_name()") Storage* byName(std::string name)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::by_name()") Storage* byName(const std::string& name)
   {
     return by_name(name);
   }
@@ -102,7 +102,8 @@ public:
     return get_property(key);
   }
   /** @deprecated Storage::set_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::set_property()") void setProperty(std::string key, std::string value)
+  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::set_property()") void setProperty(const std::string& key,
+                                                                                    const std::string& value)
   {
     set_property(key, value);
   }
index c130b32..26a008c 100644 (file)
@@ -24,8 +24,8 @@ class XBT_PUBLIC VirtualMachine : public s4u::Host {
   virtual ~VirtualMachine();
 
 public:
-  explicit VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount);
-  explicit VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount, size_t ramsize);
+  explicit VirtualMachine(const std::string& name, s4u::Host* physical_host, int core_amount);
+  explicit VirtualMachine(const std::string& name, s4u::Host* physical_host, int core_amount, size_t ramsize);
 
   // No copy/move
   VirtualMachine(VirtualMachine const&) = delete;
index fd9e4a9..aa52f47 100644 (file)
@@ -110,8 +110,9 @@ public:
 } // namespace simix
 } // namespace simgrid
 
-XBT_PUBLIC smx_actor_t simcall_process_create(std::string name, const simgrid::simix::ActorCode& code, void* data,
-                                              sg_host_t host, std::unordered_map<std::string, std::string>* properties);
+XBT_PUBLIC smx_actor_t simcall_process_create(const std::string& name, const simgrid::simix::ActorCode& code,
+                                              void* data, sg_host_t host,
+                                              std::unordered_map<std::string, std::string>* properties);
 
 XBT_PUBLIC smx_timer_t SIMIX_timer_set(double date, simgrid::xbt::Task<void()> callback);
 
index 31c394d..91f8943 100644 (file)
@@ -173,7 +173,7 @@ protected:
   T args;
 
 public:
-  explicit ReplayAction(std::string name) : name(std::move(name)), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
+  explicit ReplayAction(const std::string& name) : name(name), my_proc_id(simgrid::s4u::this_actor::get_pid()) {}
   virtual ~ReplayAction() = default;
 
   void execute(simgrid::xbt::ReplayAction& action)
@@ -205,9 +205,7 @@ private:
   RequestStorage& req_storage;
 
 public:
-  explicit SendAction(std::string name, RequestStorage& storage) : ReplayAction(std::move(name)), req_storage(storage)
-  {
-  }
+  explicit SendAction(const std::string& name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
@@ -216,9 +214,7 @@ private:
   RequestStorage& req_storage;
 
 public:
-  explicit RecvAction(std::string name, RequestStorage& storage) : ReplayAction(std::move(name)), req_storage(storage)
-  {
-  }
+  explicit RecvAction(const std::string& name, RequestStorage& storage) : ReplayAction(name), req_storage(storage) {}
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
@@ -290,13 +286,13 @@ public:
 
 class GatherAction : public ReplayAction<GatherArgParser> {
 public:
-  explicit GatherAction(std::string name) : ReplayAction(std::move(name)) {}
+  explicit GatherAction(const std::string& name) : ReplayAction(name) {}
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
 class GatherVAction : public ReplayAction<GatherVArgParser> {
 public:
-  explicit GatherVAction(std::string name) : ReplayAction(std::move(name)) {}
+  explicit GatherVAction(const std::string& name) : ReplayAction(name) {}
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
index 9bb3619..b6f60f0 100644 (file)
@@ -65,7 +65,7 @@ extern template XBT_PUBLIC void set_value<bool>(const char* name, bool value);
 extern template XBT_PUBLIC void set_value<std::string>(const char* name, std::string value);
 
 XBT_PUBLIC void set_as_string(const char* name, const std::string& value);
-XBT_PUBLIC void set_parse(std::string options);
+XBT_PUBLIC void set_parse(const std::string& options);
 
 // Get config
 
@@ -86,16 +86,16 @@ extern template XBT_PUBLIC std::string const& get_value<std::string>(const std::
  *  @param callback    called with the option value
  */
 template <class T>
-XBT_PUBLIC void declare_flag(const std::string& name, std::string description, T value,
+XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, T value,
                              std::function<void(const T&)> callback = std::function<void(const T&)>());
 
-extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, int value,
+extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, int value,
                                              std::function<void(int const&)> callback);
-extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, double value,
+extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, double value,
                                              std::function<void(double const&)> callback);
-extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, bool value,
+extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, bool value,
                                              std::function<void(bool const&)> callback);
-extern template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, std::string value,
+extern template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, std::string value,
                                              std::function<void(std::string const&)> callback);
 
 // ***** alias *****
index 4ef6c04..649296c 100644 (file)
@@ -19,7 +19,7 @@ public:
   /** Build a path from the provided parameter */
   explicit Path(const char* path): path_(path) {}
   /** Build a path from the provided parameter */
-  explicit Path(std::string path): path_(std::move(path)) {}
+  explicit Path(const std::string& path) : path_(path) {}
 
   /** @brief Returns the full path name */
   const std::string& get_name() const { return path_; }
index 4b23e35..49271aa 100644 (file)
@@ -32,8 +32,8 @@ container_t Container::get_root()
   return rootContainer;
 }
 
-NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father)
-    : Container::Container(std::move(name), "", father)
+NetZoneContainer::NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* father)
+    : Container::Container(name, "", father)
 {
   netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name());
   xbt_assert(netpoint_, "Element '%s' not found", get_cname());
@@ -48,8 +48,8 @@ NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZone
   }
 }
 
-RouterContainer::RouterContainer(std::string name, Container* father)
-    : Container::Container(std::move(name), "ROUTER", father)
+RouterContainer::RouterContainer(const std::string& name, Container* father)
+    : Container::Container(name, "ROUTER", father)
 {
   xbt_assert(father, "Only the Root container has no father");
 
@@ -70,8 +70,8 @@ HostContainer::HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father)
   trivaNodeTypes.insert(type_->get_name());
 }
 
-Container::Container(std::string name, const std::string& type_name, Container* father)
-    : name_(std::move(name)), father_(father)
+Container::Container(const std::string& name, const std::string& type_name, Container* father)
+    : name_(name), father_(father)
 {
   static long long int container_id = 0;
   id_                               = container_id; // id (or alias) of the container
@@ -117,9 +117,9 @@ Container::~Container()
   allContainers.erase(name_);
 }
 
-void Container::create_child(std::string name, const std::string& type_name)
+void Container::create_child(const std::string& name, const std::string& type_name)
 {
-  new Container(std::move(name), type_name, this);
+  new Container(name, type_name, this);
 }
 
 Container* Container::by_name_or_null(const std::string& name)
index 0e49398..e4c33e6 100644 (file)
@@ -20,7 +20,7 @@ class Container {
   long long int id_;
   std::string name_; /* Unique name of this container */
 public:
-  Container(std::string name, const std::string& type_name, Container* father);
+  Container(const std::string& name, const std::string& type_name, Container* father);
   Container(const Container&) = delete;
   Container& operator=(const Container&) = delete;
   virtual ~Container();
@@ -42,18 +42,18 @@ public:
   StateType* get_state(const std::string& name);
   LinkType* get_link(const std::string& name);
   VariableType* get_variable(const std::string& name);
-  void create_child(std::string name, const std::string& type_name);
+  void create_child(const std::string& name, const std::string& type_name);
   static Container* get_root();
 };
 
 class NetZoneContainer : public Container {
 public:
-  NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father);
+  NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* father);
 };
 
 class RouterContainer : public Container {
 public:
-  RouterContainer(std::string name, Container* father);
+  RouterContainer(const std::string& name, Container* father);
 };
 
 class HostContainer : public Container {
index 3b1da03..71dd4c7 100644 (file)
@@ -84,12 +84,12 @@ class LinkEvent : public PajeEvent {
   int size_ = -1;
 
 public:
-  LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value,
-            std::string key, int size)
+  LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer,
+            const std::string& value, const std::string& key, int size)
       : PajeEvent(container, type, SIMIX_get_clock(), event_type)
       , endpoint_(sourceContainer)
-      , value_(std::move(value))
-      , key_(std::move(key))
+      , value_(value)
+      , key_(key)
       , size_(size)
   {
   }
index c08aea0..3df9437 100644 (file)
@@ -15,14 +15,14 @@ static std::set<std::string> platform_variables;
 namespace simgrid {
 namespace instr {
 
-Type::Type(std::string name, std::string alias, std::string color, Type* father)
-    : id_(instr_new_paje_id()), name_(std::move(name)), color_(std::move(color)), father_(father)
+Type::Type(const std::string& name, const std::string& alias, const std::string& color, Type* father)
+    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father)
 {
   if (name_.empty() || alias.empty())
     THROWF(tracing_error, 0, "can't create a new type with no name or alias");
 
   if (father != nullptr){
-    father->children_.insert({std::move(alias), this});
+    father->children_.insert({alias, this});
     XBT_DEBUG("new type %s, child of %s", get_cname(), father->get_cname());
   }
   if (trace_format == simgrid::instr::TraceFormat::Paje) {
@@ -48,13 +48,13 @@ ContainerType::ContainerType(const std::string& name, Type* father) : Type(name,
   log_definition(PAJE_DefineContainerType);
 }
 
-EventType::EventType(std::string name, Type* father) : ValueType(std::move(name), father)
+EventType::EventType(const std::string& name, Type* father) : ValueType(name, father)
 {
   XBT_DEBUG("EventType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
   log_definition(PAJE_DefineEventType);
 }
 
-StateType::StateType(std::string name, Type* father) : ValueType(std::move(name), father)
+StateType::StateType(const std::string& name, Type* father) : ValueType(name, father)
 {
   XBT_DEBUG("StateType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
   log_definition(PAJE_DefineStateType);
@@ -90,8 +90,8 @@ void StateType::pop_event(TIData* extra)
   events_.push_back(new StateEvent(issuer_, this, PAJE_PopState, nullptr, extra));
 }
 
-VariableType::VariableType(const std::string& name, std::string color, Type* father)
-    : Type(name, name, std::move(color), father)
+VariableType::VariableType(const std::string& name, const std::string& color, Type* father)
+    : Type(name, name, color, father)
 {
   XBT_DEBUG("VariableType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
   log_definition(PAJE_DefineVariableType);
@@ -137,23 +137,22 @@ void VariableType::sub_event(double timestamp, double value)
   events_.push_back(new VariableEvent(timestamp, issuer_, this, PAJE_SubVariable, value));
 }
 
-LinkType::LinkType(std::string name, std::string alias, Type* father)
-    : ValueType(std::move(name), std::move(alias), father)
+LinkType::LinkType(const std::string& name, const std::string& alias, Type* father) : ValueType(name, alias, father)
 {
 }
-void LinkType::start_event(Container* startContainer, std::string value, std::string key)
+void LinkType::start_event(Container* startContainer, const std::string& value, const std::string& key)
 {
-  start_event(startContainer, value, std::move(key), -1);
+  start_event(startContainer, value, key, -1);
 }
 
-void LinkType::start_event(Container* startContainer, std::string value, std::string key, int size)
+void LinkType::start_event(Container* startContainer, const std::string& value, const std::string& key, int size)
 {
-  new LinkEvent(issuer_, this, PAJE_StartLink, startContainer, value, std::move(key), size);
+  new LinkEvent(issuer_, this, PAJE_StartLink, startContainer, value, key, size);
 }
 
-void LinkType::end_event(Container* endContainer, std::string value, std::string key)
+void LinkType::end_event(Container* endContainer, const std::string& value, const std::string& key)
 {
-  new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, std::move(key), -1);
+  new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, key, -1);
 }
 
 void Type::log_definition(e_event_type event_type)
@@ -201,14 +200,14 @@ void ValueType::add_entity_value(const std::string& name)
   add_entity_value(name, "");
 }
 
-void ValueType::add_entity_value(const std::string& name, std::string color)
+void ValueType::add_entity_value(const std::string& name, const std::string& color)
 {
   if (name.empty())
     THROWF(tracing_error, 0, "can't get a value with no name");
 
   auto it = values_.find(name);
   if (it == values_.end()) {
-    EntityValue* new_val = new EntityValue(name, std::move(color), this);
+    EntityValue* new_val = new EntityValue(name, color, this);
     values_.insert({name, new_val});
     XBT_DEBUG("new value %s, child of %s", name.c_str(), get_cname());
     new_val->print();
@@ -224,12 +223,11 @@ EntityValue* ValueType::get_entity_value(const std::string& name)
   return ret->second;
 }
 
-VariableType* Type::by_name_or_create(const std::string& name, std::string color)
+VariableType* Type::by_name_or_create(const std::string& name, const std::string& color)
 {
   auto cont = children_.find(name);
-  std::string mycolor = color.empty() ? "1 1 1" : std::move(color);
-  return cont == children_.end() ? new VariableType(name, std::move(mycolor), this)
-                                 : static_cast<VariableType*>(cont->second);
+  std::string mycolor = color.empty() ? "1 1 1" : color;
+  return cont == children_.end() ? new VariableType(name, mycolor, this) : static_cast<VariableType*>(cont->second);
 }
 
 LinkType* Type::by_name_or_create(const std::string& name, Type* source, Type* dest)
index 47ed87c..eed2593 100644 (file)
@@ -27,7 +27,7 @@ public:
   Container* issuer_ = nullptr;
   std::stringstream stream_;
 
-  Type(std::string name, std::string alias, std::string color, Type* father);
+  Type(const std::string& name, const std::string& alias, const std::string& color, Type* father);
   virtual ~Type();
 
   const std::string& get_name() const { return name_; }
@@ -37,7 +37,7 @@ public:
 
   Type* by_name(const std::string& name);
   LinkType* by_name_or_create(const std::string& name, Type* source, Type* dest);
-  VariableType* by_name_or_create(const std::string& name, std::string color);
+  VariableType* by_name_or_create(const std::string& name, const std::string& color);
 
   template <class T> T* by_name_or_create(const std::string& name)
   {
@@ -60,7 +60,7 @@ public:
 class VariableType : public Type {
   std::vector<VariableEvent*> events_;
 public:
-  VariableType(const std::string& name, std::string color, Type* father);
+  VariableType(const std::string& name, const std::string& color, Type* father);
   ~VariableType();
   void instr_event(double now, double delta, const char* resource, double value);
   void set_event(double timestamp, double value);
@@ -71,31 +71,31 @@ public:
 class ValueType : public Type {
 public:
   std::map<std::string, EntityValue*> values_;
-  ValueType(std::string name, std::string alias, Type* father) : Type(std::move(name), std::move(alias), "", father){};
+  ValueType(const std::string& name, const std::string& alias, Type* father) : Type(name, alias, "", father){};
   ValueType(const std::string& name, Type* father) : Type(name, name, "", father){};
   virtual ~ValueType();
-  void add_entity_value(const std::string& name, std::string color);
+  void add_entity_value(const std::string& name, const std::string& color);
   void add_entity_value(const std::string& name);
   EntityValue* get_entity_value(const std::string& name);
 };
 
 class LinkType : public ValueType {
 public:
-  LinkType(std::string name, std::string alias, Type* father);
-  void start_event(Container* startContainer, std::string value, std::string key);
-  void start_event(Container* startContainer, std::string value, std::string key, int size);
-  void end_event(Container* endContainer, std::string value, std::string key);
+  LinkType(const std::string& name, const std::string& alias, Type* father);
+  void start_event(Container* startContainer, const std::string& value, const std::string& key);
+  void start_event(Container* startContainer, const std::string& value, const std::string& key, int size);
+  void end_event(Container* endContainer, const std::string& value, const std::string& key);
 };
 
 class EventType : public ValueType {
 public:
-  EventType(std::string name, Type* father);
+  EventType(const std::string& name, Type* father);
 };
 
 class StateType : public ValueType {
   std::vector<StateEvent*> events_;
 public:
-  StateType(std::string name, Type* father);
+  StateType(const std::string& name, Type* father);
   ~StateType();
   void set_event(const std::string& value_name);
   void push_event(const std::string& value_name);
index 4b584d6..6a4bd38 100644 (file)
@@ -12,8 +12,8 @@ extern std::ofstream tracing_file;
 namespace simgrid {
 namespace instr {
 
-EntityValue::EntityValue(std::string name, std::string color, Type* father)
-    : id_(instr_new_paje_id()), name_(std::move(name)), color_(std::move(color)), father_(father){};
+EntityValue::EntityValue(const std::string& name, const std::string& color, Type* father)
+    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father){};
 
 void EntityValue::print()
 {
index 64a5951..4e96d8a 100644 (file)
@@ -19,7 +19,7 @@ class EntityValue {
   Type* father_;
 
 public:
-  explicit EntityValue(std::string name, std::string color, Type* father);
+  explicit EntityValue(const std::string& name, const std::string& color, Type* father);
   ~EntityValue() = default;
   const char* get_cname() { return name_.c_str(); }
   long long int get_id() { return id_; }
index ca0119c..c5886f5 100644 (file)
@@ -59,39 +59,39 @@ public:
   std::string recv_type        = "";
 
   // NoOpTI: init, finalize, test, wait, barrier
-  explicit TIData(std::string name) : name_(std::move(name)){};
+  explicit TIData(const std::string& name) : name_(name){};
   // CPuTI: compute, sleep (+ waitAny and waitall out of laziness)
-  explicit TIData(std::string name, double amount) : name_(std::move(name)), amount_(amount){};
+  explicit TIData(const std::string& name, double amount) : name_(name), amount_(amount){};
   // Pt2PtTI: send, isend, sssend, issend, recv, irecv
-  explicit TIData(std::string name, int endpoint, int size, std::string datatype)
-      : name_(std::move(name)), endpoint(endpoint), send_size(size), send_type(std::move(datatype)){};
+  explicit TIData(const std::string& name, int endpoint, int size, const std::string& datatype)
+      : name_(name), endpoint(endpoint), send_size(size), send_type(datatype){};
   // CollTI: bcast, reduce, allreduce, gather, scatter, allgather, alltoall
-  explicit TIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type,
-                  std::string recv_type)
-      : name_(std::move(name))
+  explicit TIData(const std::string& name, int root, double amount, int send_size, int recv_size,
+                  const std::string& send_type, const std::string& recv_type)
+      : name_(name)
       , amount_(amount)
       , endpoint(root)
       , send_size(send_size)
       , recv_size(recv_size)
-      , send_type(std::move(send_type))
-      , recv_type(std::move(recv_type)){};
+      , send_type(send_type)
+      , recv_type(recv_type){};
   // VarCollTI: gatherv, scatterv, allgatherv, alltoallv (+ reducescatter out of laziness)
-  explicit TIData(std::string name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
-                  std::vector<int>* recvcounts, std::string send_type, std::string recv_type)
-      : TIData(std::move(name), root, send_size, std::shared_ptr<std::vector<int>>(sendcounts), recv_size,
-               std::shared_ptr<std::vector<int>>(recvcounts), std::move(send_type), std::move(recv_type)){};
-
-  explicit TIData(std::string name, int root, int send_size, std::shared_ptr<std::vector<int>> sendcounts,
-                  int recv_size, std::shared_ptr<std::vector<int>> recvcounts, std::string send_type,
-                  std::string recv_type)
-      : name_(std::move(name))
+  explicit TIData(const std::string& name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
+                  std::vector<int>* recvcounts, const std::string& send_type, const std::string& recv_type)
+      : TIData(name, root, send_size, std::shared_ptr<std::vector<int>>(sendcounts), recv_size,
+               std::shared_ptr<std::vector<int>>(recvcounts), send_type, recv_type){};
+
+  explicit TIData(const std::string& name, int root, int send_size, std::shared_ptr<std::vector<int>> sendcounts,
+                  int recv_size, std::shared_ptr<std::vector<int>> recvcounts, const std::string& send_type,
+                  const std::string& recv_type)
+      : name_(name)
       , endpoint(root)
       , send_size(send_size)
       , sendcounts(sendcounts)
       , recv_size(recv_size)
       , recvcounts(recvcounts)
-      , send_type(std::move(send_type))
-      , recv_type(std::move(recv_type)){};
+      , send_type(send_type)
+      , recv_type(recv_type){};
 
   virtual ~TIData() {}
 
@@ -103,14 +103,14 @@ public:
 
 class NoOpTIData : public TIData {
 public:
-  explicit NoOpTIData(std::string name) : TIData(std::move(name)){};
+  explicit NoOpTIData(const std::string& name) : TIData(name){};
   std::string print() override { return getName(); }
   std::string display_size() override { return "NA"; }
 };
 
 class CpuTIData : public TIData {
 public:
-  explicit CpuTIData(std::string name, double amount) : TIData(std::move(name), amount){};
+  explicit CpuTIData(const std::string& name, double amount) : TIData(name, amount){};
   std::string print() override
   {
     std::stringstream stream;
@@ -123,11 +123,11 @@ public:
 class Pt2PtTIData : public TIData {
   int tag;
 public:
-  explicit Pt2PtTIData(std::string name, int endpoint, int size, int tag, std::string datatype)
-      : TIData(std::move(name), endpoint, size, std::move(datatype)), tag(tag){};
+  explicit Pt2PtTIData(const std::string& name, int endpoint, int size, int tag, const std::string& datatype)
+      : TIData(name, endpoint, size, datatype), tag(tag){};
 
-  explicit Pt2PtTIData(std::string name, int endpoint, int size, std::string datatype)
-      : TIData(std::move(name), endpoint, size, std::move(datatype)), tag(0){};
+  explicit Pt2PtTIData(const std::string& name, int endpoint, int size, const std::string& datatype)
+      : TIData(name, endpoint, size, datatype), tag(0){};
   std::string print() override
   {
     std::stringstream stream;
@@ -140,9 +140,9 @@ public:
 
 class CollTIData : public TIData {
 public:
-  explicit CollTIData(std::string name, int root, double amount, int send_size, int recv_size, std::string send_type,
-                      std::string recv_type)
-      : TIData(std::move(name), root, amount, send_size, recv_size, std::move(send_type), std::move(recv_type)){};
+  explicit CollTIData(const std::string& name, int root, double amount, int send_size, int recv_size,
+                      const std::string& send_type, const std::string& recv_type)
+      : TIData(name, root, amount, send_size, recv_size, send_type, recv_type){};
   std::string print() override
   {
     std::stringstream stream;
@@ -162,16 +162,14 @@ public:
 
 class VarCollTIData : public TIData {
 public:
-  explicit VarCollTIData(std::string name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
-                         std::vector<int>* recvcounts, std::string send_type, std::string recv_type)
-      : TIData(std::move(name), root, send_size, sendcounts, recv_size, recvcounts, std::move(send_type),
-               std::move(recv_type)){};
-
-  explicit VarCollTIData(std::string name, int root, int send_size, std::shared_ptr<std::vector<int>> sendcounts,
-                         int recv_size, std::shared_ptr<std::vector<int>> recvcounts, std::string send_type,
-                         std::string recv_type)
-      : TIData(std::move(name), root, send_size, sendcounts, recv_size, recvcounts, std::move(send_type),
-               std::move(recv_type)){};
+  explicit VarCollTIData(const std::string& name, int root, int send_size, std::vector<int>* sendcounts, int recv_size,
+                         std::vector<int>* recvcounts, const std::string& send_type, const std::string& recv_type)
+      : TIData(name, root, send_size, sendcounts, recv_size, recvcounts, send_type, recv_type){};
+
+  explicit VarCollTIData(const std::string& name, int root, int send_size, std::shared_ptr<std::vector<int>> sendcounts,
+                         int recv_size, std::shared_ptr<std::vector<int>> recvcounts, const std::string& send_type,
+                         const std::string& recv_type)
+      : TIData(name, root, send_size, sendcounts, recv_size, recvcounts, send_type, recv_type){};
 
   std::string print() override
   {
index 2fe5ea7..afe5c57 100644 (file)
@@ -14,7 +14,7 @@
 XBT_PRIVATE container_t smpi_container(int rank);
 XBT_PRIVATE void TRACE_smpi_setup_container(int rank, sg_host_t host);
 
-XBT_PRIVATE void TRACE_internal_smpi_set_category(std::string category);
+XBT_PRIVATE void TRACE_internal_smpi_set_category(const std::string& category);
 XBT_PRIVATE std::string TRACE_internal_smpi_get_category();
 XBT_PRIVATE void TRACE_smpi_computing_init(int rank);
 XBT_PRIVATE void TRACE_smpi_computing_out(int rank);
index 55c22f7..c166df4 100644 (file)
@@ -12,8 +12,8 @@
 namespace simgrid{
 namespace jedule{
 
-Event::Event(std::string name, double start_time, double end_time, std::string type)
-    : name_(std::move(name)), start_time_(start_time), end_time_(end_time), type_(std::move(type))
+Event::Event(const std::string& name, double start_time, double end_time, const std::string& type)
+    : name_(name), start_time_(start_time), end_time_(end_time), type_(type)
 {
   this->resource_subsets_ = new std::vector<jed_subset_t>();
 }
index a228b90..372c9c2 100644 (file)
@@ -24,7 +24,7 @@ Subset::Subset(int start_idx, int end_idx, Container* parent)
   nres=end_idx-start_idx+1;
 }
 
-Container::Container(std::string name) : name(std::move(name))
+Container::Container(const std::string& name) : name(name)
 {
   container_name2container.insert({this->name, this});
 }
index 1cb313a..5b5c614 100644 (file)
@@ -29,10 +29,10 @@ void ActivityImpl::resume()
   on_resumed(this);
 }
 
-void ActivityImpl::set_category(std::string category)
+void ActivityImpl::set_category(const std::string& category)
 {
   if (surf_action_)
-    surf_action_->set_category(std::move(category));
+    surf_action_->set_category(category);
 }
 
 // boost::intrusive_ptr<Activity> support:
index 70e4b59..0bfa602 100644 (file)
@@ -23,7 +23,7 @@ namespace activity {
 class XBT_PUBLIC ActivityImpl {
 public:
   ActivityImpl() = default;
-  explicit ActivityImpl(std::string name) : name_(std::move(name)) {}
+  explicit ActivityImpl(const std::string& name) : name_(name) {}
   virtual ~ActivityImpl() = default;
   e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */
   std::list<smx_simcall_t> simcalls_;   /* List of simcalls waiting for this activity */
@@ -36,7 +36,7 @@ public:
   virtual void resume();
   virtual void post()   = 0; // What to do when a simcall terminates
   virtual void finish() = 0;
-  void set_category(std::string category);
+  void set_category(const std::string& category);
 
   // boost::intrusive_ptr<ActivityImpl> support:
   friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
index daacc4a..c76752f 100644 (file)
@@ -37,7 +37,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-IoImpl::IoImpl(std::string name, surf::StorageImpl* storage) : ActivityImpl(std::move(name)), storage_(storage)
+IoImpl::IoImpl(const std::string& name, surf::StorageImpl* storage) : ActivityImpl(name), storage_(storage)
 {
   this->state_ = SIMIX_RUNNING;
 
index a4288e0..0577069 100644 (file)
@@ -17,7 +17,7 @@ namespace activity {
 class XBT_PUBLIC IoImpl : public ActivityImpl {
 public:
   ~IoImpl() override;
-  explicit IoImpl(std::string name, surf::StorageImpl* storage);
+  explicit IoImpl(const std::string& name, surf::StorageImpl* storage);
 
   IoImpl* start(sg_size_t size, simgrid::s4u::Io::OpType type);
   void post() override;
index 2620d7e..53043fc 100644 (file)
@@ -26,8 +26,8 @@ class MailboxImpl {
   friend s4u::MailboxPtr s4u::Mailbox::by_name(const std::string& name);
   friend mc::CommunicationDeterminismChecker;
 
-  explicit MailboxImpl(std::string name)
-      : piface_(this), name_(std::move(name)), comm_queue_(MAX_MAILBOX_SIZE), done_comm_queue_(MAX_MAILBOX_SIZE)
+  explicit MailboxImpl(const std::string& name)
+      : piface_(this), name_(name), comm_queue_(MAX_MAILBOX_SIZE), done_comm_queue_(MAX_MAILBOX_SIZE)
   {
   }
 
index 5ab94f8..32e6820 100644 (file)
@@ -17,7 +17,7 @@ class XBT_PUBLIC SleepImpl : public ActivityImpl {
   ~SleepImpl() override;
 
 public:
-  explicit SleepImpl(std::string name, s4u::Host* host) : ActivityImpl(std::move(name)), host_(host) {}
+  explicit SleepImpl(const std::string& name, s4u::Host* host) : ActivityImpl(name), host_(host) {}
   void post() override;
   void finish() override;
   SleepImpl* start(double duration);
index 2f3d067..021eddd 100644 (file)
@@ -17,8 +17,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf"
 namespace simgrid {
 namespace kernel {
 namespace routing {
-ClusterZone::ClusterZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : NetZoneImpl(father, std::move(name), netmodel)
+ClusterZone::ClusterZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : NetZoneImpl(father, name, netmodel)
 {
 }
 
index a63574b..3645a4f 100644 (file)
@@ -26,8 +26,8 @@ public:
   int graph_id_ = -1; /* used for caching internal graph id's */
 };
 
-DijkstraZone::DijkstraZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel, bool cached)
-    : RoutedZone(father, std::move(name), netmodel), cached_(cached)
+DijkstraZone::DijkstraZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel, bool cached)
+    : RoutedZone(father, name, netmodel), cached_(cached)
 {
 }
 
index 603c605..68235e4 100644 (file)
@@ -18,8 +18,8 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-DragonflyZone::DragonflyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, std::move(name), netmodel)
+DragonflyZone::DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : ClusterZone(father, name, netmodel)
 {
 }
 
@@ -160,7 +160,7 @@ void DragonflyZone::generate_routers()
   }
 }
 
-void DragonflyZone::create_link(std::string id, int numlinks, resource::LinkImpl** linkup,
+void DragonflyZone::create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup,
                                 resource::LinkImpl** linkdown)
 {
   *linkup   = nullptr;
index bd04471..0c4407a 100644 (file)
@@ -15,8 +15,8 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-EmptyZone::EmptyZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : NetZoneImpl(father, std::move(name), netmodel)
+EmptyZone::EmptyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : NetZoneImpl(father, name, netmodel)
 {
 }
 
index c017815..ae1556c 100644 (file)
@@ -22,8 +22,8 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-FatTreeZone::FatTreeZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, std::move(name), netmodel)
+FatTreeZone::FatTreeZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : ClusterZone(father, name, netmodel)
 {
   XBT_DEBUG("Creating a new fat tree.");
 }
index c3d32b3..e791ece 100644 (file)
@@ -22,8 +22,8 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-FloydZone::FloydZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : RoutedZone(father, std::move(name), netmodel)
+FloydZone::FloydZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : RoutedZone(father, name, netmodel)
 {
   predecessor_table_ = nullptr;
   cost_table_        = nullptr;
index f95f6e7..779c949 100644 (file)
@@ -16,8 +16,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 namespace simgrid {
 namespace kernel {
 namespace routing {
-FullZone::FullZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : RoutedZone(father, std::move(name), netmodel)
+FullZone::FullZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : RoutedZone(father, name, netmodel)
 {
 }
 
index 87409f6..f723a2e 100644 (file)
@@ -15,8 +15,8 @@ namespace routing {
 
 simgrid::xbt::signal<void(NetPoint*)> NetPoint::on_creation;
 
-NetPoint::NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl* netzone_p)
-    : name_(std::move(name)), component_type_(componentType), englobing_zone_(netzone_p)
+NetPoint::NetPoint(const std::string& name, NetPoint::Type componentType, NetZoneImpl* netzone_p)
+    : name_(name), component_type_(componentType), englobing_zone_(netzone_p)
 {
   if (netzone_p != nullptr)
     id_ = netzone_p->add_component(this);
index fc33fd2..2889810 100644 (file)
@@ -26,8 +26,8 @@ public:
   std::vector<resource::LinkImpl*> links;
 };
 
-NetZoneImpl::NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model)
-    : network_model_(network_model), piface_(this), father_(father), name_(std::move(name))
+NetZoneImpl::NetZoneImpl(NetZoneImpl* father, const std::string& name, resource::NetworkModel* network_model)
+    : network_model_(network_model), piface_(this), father_(father), name_(name)
 {
   xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()),
              "Refusing to create a second NetZone called '%s'.", get_cname());
index 89685b1..090085d 100644 (file)
@@ -59,8 +59,8 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-RoutedZone::RoutedZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : NetZoneImpl(father, std::move(name), netmodel)
+RoutedZone::RoutedZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : NetZoneImpl(father, name, netmodel)
 {
 }
 
index 1ea74b3..dd4e9a3 100644 (file)
@@ -18,8 +18,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "T
 namespace simgrid {
 namespace kernel {
 namespace routing {
-TorusZone::TorusZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, std::move(name), netmodel)
+TorusZone::TorusZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : ClusterZone(father, name, netmodel)
 {
 }
 
index 88c8d98..48a2ac9 100644 (file)
@@ -59,8 +59,8 @@ static std::vector<double>* netpoint_get_coords(NetPoint* np)
   return &coords->coords;
 }
 
-VivaldiZone::VivaldiZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
-    : ClusterZone(father, std::move(name), netmodel)
+VivaldiZone::VivaldiZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel)
+    : ClusterZone(father, name, netmodel)
 {
 }
 
index 8183746..cdc1151 100644 (file)
@@ -48,7 +48,7 @@ void replay(RecordTrace const& trace)
   }
 }
 
-void replay(std::string path_string)
+void replay(const std::string& path_string)
 {
   simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
   simgrid::mc::RecordTrace trace = simgrid::mc::parseRecordTrace(path_string.c_str());
index 5ac85d9..df5285e 100644 (file)
@@ -35,7 +35,7 @@ XBT_PRIVATE std::string traceToString(simgrid::mc::RecordTrace const& trace);
 XBT_PRIVATE void dumpRecordPath();
 
 XBT_PRIVATE void replay(RecordTrace const& trace);
-XBT_PRIVATE void replay(std::string trace);
+XBT_PRIVATE void replay(const std::string& trace);
 }
 }
 
index ab76546..951f37e 100644 (file)
@@ -28,19 +28,19 @@ class Task {
   double rate_     = -1;    /* Capping for network resource, or -1 for no capping*/
   bool is_used_    = false; /* Indicates whether the task is used in SIMIX currently */
 
-  explicit Task(std::string name, double flops_amount, double bytes_amount, void* data);
-  explicit Task(std::string name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
+  explicit Task(const std::string& name, double flops_amount, double bytes_amount, void* data);
+  explicit Task(const std::string& name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
                 std::vector<double>&& bytes_amount, void* data);
 
   void report_multiple_use() const;
 
 public:
-  static Task* create(std::string name, double flops_amount, double bytes_amount, void* data);
-  static Task* create_parallel(std::string name, int host_nb, const msg_host_t* host_list, double* flops_amount,
+  static Task* create(const std::string& name, double flops_amount, double bytes_amount, void* data);
+  static Task* create_parallel(const std::string& name, int host_nb, const msg_host_t* host_list, double* flops_amount,
                                double* bytes_amount, void* data);
   msg_error_t execute();
-  msg_error_t send(std::string alias, double timeout);
-  s4u::CommPtr send_async(std::string alias, void_f_pvoid_t cleanup, bool detached);
+  msg_error_t send(const std::string& alias, double timeout);
+  s4u::CommPtr send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached);
 
   void cancel();
 
index 8068a8d..4ad294b 100644 (file)
@@ -18,8 +18,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)")
 namespace simgrid {
 namespace msg {
 
-Task::Task(std::string name, double flops_amount, double bytes_amount, void* data)
-    : name_(std::move(name)), userdata_(data), flops_amount(flops_amount), bytes_amount(bytes_amount)
+Task::Task(const std::string& name, double flops_amount, double bytes_amount, void* data)
+    : name_(name), userdata_(data), flops_amount(flops_amount), bytes_amount(bytes_amount)
 {
   static std::atomic_ullong counter{0};
   id_ = counter++;
@@ -27,9 +27,9 @@ Task::Task(std::string name, double flops_amount, double bytes_amount, void* dat
     MC_ignore_heap(&(id_), sizeof(id_));
 }
 
-Task::Task(std::string name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
+Task::Task(const std::string& name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
            std::vector<double>&& bytes_amount, void* data)
-    : Task(std::move(name), 1.0, 0, data)
+    : Task(name, 1.0, 0, data)
 {
   parallel_             = true;
   hosts_                = std::move(hosts);
@@ -37,12 +37,12 @@ Task::Task(std::string name, std::vector<s4u::Host*>&& hosts, std::vector<double
   bytes_parallel_amount = std::move(bytes_amount);
 }
 
-Task* Task::create(std::string name, double flops_amount, double bytes_amount, void* data)
+Task* Task::create(const std::string& name, double flops_amount, double bytes_amount, void* data)
 {
   return new Task(std::move(name), flops_amount, bytes_amount, data);
 }
 
-Task* Task::create_parallel(std::string name, int host_nb, const msg_host_t* host_list, double* flops_amount,
+Task* Task::create_parallel(const std::string& name, int host_nb, const msg_host_t* host_list, double* flops_amount,
                             double* bytes_amount, void* data)
 {
   std::vector<s4u::Host*> hosts;
@@ -102,7 +102,7 @@ msg_error_t Task::execute()
   return status;
 }
 
-s4u::CommPtr Task::send_async(std::string alias, void_f_pvoid_t cleanup, bool detached)
+s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached)
 {
   if (TRACE_actor_is_enabled()) {
     container_t process_container = simgrid::instr::Container::by_name(instr_pid(MSG_process_self()));
@@ -129,7 +129,7 @@ s4u::CommPtr Task::send_async(std::string alias, void_f_pvoid_t cleanup, bool de
   return comm;
 }
 
-msg_error_t Task::send(std::string alias, double timeout)
+msg_error_t Task::send(const std::string& alias, double timeout)
 {
   msg_error_t ret = MSG_OK;
   /* Try to send it */
index 968e885..74227e3 100644 (file)
@@ -23,9 +23,9 @@ namespace s4u {
 simgrid::xbt::Extension<Storage, FileSystemStorageExt> FileSystemStorageExt::EXTENSION_ID;
 simgrid::xbt::Extension<Host, FileDescriptorHostExt> FileDescriptorHostExt::EXTENSION_ID;
 
-File::File(std::string fullpath, void* userdata) : File(std::move(fullpath), Host::current(), userdata){};
+File::File(const std::string& fullpath, void* userdata) : File(fullpath, Host::current(), userdata){};
 
-File::File(std::string fullpath, sg_host_t host, void* userdata) : fullpath_(std::move(fullpath)), userdata_(userdata)
+File::File(const std::string& fullpath, sg_host_t host, void* userdata) : fullpath_(fullpath), userdata_(userdata)
 {
   // this cannot fail because we get a xbt_die if the mountpoint does not exist
   Storage* st                  = nullptr;
index 2f161d1..cda87c0 100644 (file)
@@ -26,19 +26,21 @@ static simgrid::config::Flag<double> cfg_sampling_rate("plugin/dvfs/sampling-rat
     [](double val){if (val != 0.1) sg_host_dvfs_plugin_init();});
 
 static simgrid::config::Flag<std::string> cfg_governor("plugin/dvfs/governor",
-    "Which Governor should be used that adapts the CPU frequency?", "performance",
+                                                       "Which Governor should be used that adapts the CPU frequency?",
+                                                       "performance",
 
-    std::map<std::string, std::string>({
+                                                       std::map<std::string, std::string>({
 #if HAVE_SMPI
-        {"adagio", "TODO: Doc"},
+                                                         {"adagio", "TODO: Doc"},
 #endif
-        {"conservative", "TODO: Doc"},
-        {"ondemand", "TODO: Doc"},
-        {"performance", "TODO: Doc"},
-        {"powersave", "TODO: Doc"},
-    }),
-
-    [](std::string val) { if (val != "performance") sg_host_dvfs_plugin_init(); });
+                                                             {"conservative", "TODO: Doc"}, {"ondemand", "TODO: Doc"},
+                                                             {"performance", "TODO: Doc"}, {"powersave", "TODO: Doc"},
+                                                       }),
+
+                                                       [](const std::string& val) {
+                                                         if (val != "performance")
+                                                           sg_host_dvfs_plugin_init();
+                                                       });
 
 static simgrid::config::Flag<int>
     cfg_min_pstate("plugin/dvfs/min-pstate", {"plugin/dvfs/min_pstate"},
index d2c56be..9483c03 100644 (file)
@@ -23,13 +23,13 @@ simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_resume;
 simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_migration_start;
 simgrid::xbt::signal<void(VirtualMachine&)> VirtualMachine::on_migration_end;
 
-VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount)
-    : VirtualMachine(std::move(name), physical_host, core_amount, 1024)
+VirtualMachine::VirtualMachine(const std::string& name, s4u::Host* physical_host, int core_amount)
+    : VirtualMachine(name, physical_host, core_amount, 1024)
 {
 }
 
-VirtualMachine::VirtualMachine(std::string name, s4u::Host* physical_host, int core_amount, size_t ramsize)
-    : Host(std::move(name)), pimpl_vm_(new vm::VirtualMachineImpl(this, physical_host, core_amount, ramsize))
+VirtualMachine::VirtualMachine(const std::string& name, s4u::Host* physical_host, int core_amount, size_t ramsize)
+    : Host(name), pimpl_vm_(new vm::VirtualMachineImpl(this, physical_host, core_amount, ramsize))
 {
   // xbt_assert(s4u::Host::by_name(name) == nullptr,
   //           "Cannot create a VM named %s: this name is already used by a host or a VM", get_cname());
index 6cd3ede..934e52b 100644 (file)
@@ -39,11 +39,11 @@ ActorPtr Actor::self()
 
   return self_context->get_actor()->iface();
 }
-ActorPtr Actor::init(std::string name, s4u::Host* host)
+ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
   smx_actor_t self = SIMIX_process_self();
   simgrid::kernel::actor::ActorImpl* actor =
-      simgrid::simix::simcall([self, name, host] { return self->init(std::move(name), host).get(); });
+      simgrid::simix::simcall([self, &name, host] { return self->init(name, host).get(); });
   return actor->ciface();
 }
 
@@ -53,17 +53,18 @@ ActorPtr Actor::start(const std::function<void()>& code)
   return this;
 }
 
-ActorPtr Actor::create(std::string name, s4u::Host* host, const std::function<void()>& code)
+ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::function<void()>& code)
 {
-  simgrid::kernel::actor::ActorImpl* actor = simcall_process_create(std::move(name), code, nullptr, host, nullptr);
+  simgrid::kernel::actor::ActorImpl* actor = simcall_process_create(name, code, nullptr, host, nullptr);
 
   return actor->iface();
 }
 
-ActorPtr Actor::create(std::string name, s4u::Host* host, const std::string& function, std::vector<std::string> args)
+ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::string& function,
+                       std::vector<std::string> args)
 {
   simgrid::simix::ActorCodeFactory& factory = SIMIX_get_actor_code_factory(function);
-  return create(std::move(name), host, factory(std::move(args)));
+  return create(name, host, factory(std::move(args)));
 }
 
 void intrusive_ptr_add_ref(Actor* actor)
@@ -253,12 +254,12 @@ std::unordered_map<std::string, std::string>* Actor::get_properties()
 /** Retrieve the property value (or nullptr if not set) */
 const char* Actor::get_property(const std::string& key)
 {
-  return simgrid::simix::simcall([this, key] { return pimpl_->get_property(key); });
+  return simgrid::simix::simcall([this, &key] { return pimpl_->get_property(key); });
 }
 
-void Actor::set_property(const std::string& key, std::string value)
+void Actor::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, key, value] { pimpl_->set_property(key, std::move(value)); });
+  simgrid::simix::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
 }
 
 Actor* Actor::restart()
index 4e7a3f3..d778b75 100644 (file)
@@ -375,9 +375,9 @@ bool Engine::is_initialized()
 {
   return Engine::instance_ != nullptr;
 }
-void Engine::set_config(std::string str)
+void Engine::set_config(const std::string& str)
 {
-  simgrid::config::set_parse(std::move(str));
+  simgrid::config::set_parse(str);
 }
 } // namespace s4u
 } // namespace simgrid
index 0cfb089..f2516f3 100644 (file)
@@ -90,10 +90,10 @@ ExecPtr Exec::set_timeout(double timeout)
   return this;
 }
 
-ExecPtr Exec::set_name(std::string name)
+ExecPtr Exec::set_name(const std::string& name)
 {
   xbt_assert(state_ == State::INITED, "Cannot change the name of an exec after its start");
-  name_ = std::move(name);
+  name_ = name;
   return this;
 }
 
@@ -110,10 +110,10 @@ ExecPtr Exec::set_priority(double priority)
   return this;
 }
 
-ExecPtr Exec::set_tracing_category(std::string category)
+ExecPtr Exec::set_tracing_category(const std::string& category)
 {
   xbt_assert(state_ == State::INITED, "Cannot change the tracing category of an exec after its start");
-  tracing_category_ = std::move(category);
+  tracing_category_ = category;
   return this;
 }
 
index ee79d41..f17edf7 100644 (file)
@@ -30,10 +30,10 @@ simgrid::xbt::signal<void(Host&)> Host::on_destruction;
 simgrid::xbt::signal<void(Host&)> Host::on_state_change;
 simgrid::xbt::signal<void(Host&)> Host::on_speed_change;
 
-Host::Host(std::string name) : name_(std::move(name))
+Host::Host(const std::string& name) : name_(name)
 {
   xbt_assert(Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", get_cname());
-  Engine::get_instance()->host_register(std::string(name_), this);
+  Engine::get_instance()->host_register(name_, this);
   new simgrid::surf::HostImpl(this);
 }
 
@@ -193,9 +193,9 @@ const char* Host::get_property(const std::string& key) const
   return this->pimpl_->get_property(key);
 }
 
-void Host::set_property(const std::string& key, std::string value)
+void Host::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, std::move(value)); });
+  simgrid::simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 /** Specify a profile turning the host on and off according to a exhaustive list or a stochastic law.
  * The profile must contain boolean values. */
index d188198..99d994e 100644 (file)
@@ -109,9 +109,9 @@ const char* Link::get_property(const std::string& key)
 {
   return this->pimpl_->get_property(key);
 }
-void Link::set_property(const std::string& key, std::string value)
+void Link::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, std::move(value)); });
+  simgrid::simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 } // namespace s4u
 } // namespace simgrid
index f31917b..0e3443d 100644 (file)
@@ -37,9 +37,9 @@ const char* NetZone::get_property(const std::string& key)
 {
   return properties_.at(key).c_str();
 }
-void NetZone::set_property(const std::string& key, std::string value)
+void NetZone::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, key, value] { properties_[key] = std::move(value); });
+  simgrid::simix::simcall([this, &key, &value] { properties_[key] = value; });
 }
 
 /** @brief Returns the list of direct children (no grand-children) */
index 78cfaf6..5aaf6eb 100644 (file)
@@ -21,7 +21,7 @@ simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_creation;
 simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_destruction;
 simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_state_change;
 
-Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(std::move(name))
+Storage::Storage(const std::string& name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(name)
 {
   simgrid::s4u::Engine::get_instance()->storage_register(name_, this);
 }
@@ -51,9 +51,9 @@ const char* Storage::get_property(const std::string& key)
   return this->pimpl_->get_property(key);
 }
 
-void Storage::set_property(const std::string& key, std::string value)
+void Storage::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
+  simgrid::simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 
 IoPtr Storage::io_init(sg_size_t size, Io::OpType type)
index d8d4d1b..e0ec997 100644 (file)
@@ -52,7 +52,7 @@ namespace simgrid {
 namespace kernel {
 namespace actor {
 
-ActorImpl::ActorImpl(simgrid::xbt::string name, s4u::Host* host) : host_(host), name_(name), piface_(this)
+ActorImpl::ActorImpl(const simgrid::xbt::string& name, s4u::Host* host) : host_(host), name_(name), piface_(this)
 {
   pid_ = simix_process_maxpid++;
   simcall.issuer = this;
@@ -68,7 +68,7 @@ ActorImpl::~ActorImpl() = default;
  * In the future, it might be extended in order to attach other threads created by a third party library.
  */
 
-ActorImplPtr ActorImpl::attach(std::string name, void* data, s4u::Host* host,
+ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* host,
                                std::unordered_map<std::string, std::string>* properties)
 {
   // This is mostly a copy/paste from create(), it'd be nice to share some code between those two functions.
@@ -442,7 +442,7 @@ void ActorImpl::set_host(s4u::Host* dest)
   dest->pimpl_->process_list_.push_back(*this);
 }
 
-ActorImplPtr ActorImpl::init(std::string name, s4u::Host* host)
+ActorImplPtr ActorImpl::init(const std::string& name, s4u::Host* host)
 {
   ActorImpl* actor = new ActorImpl(simgrid::xbt::string(name), host);
   actor->set_ppid(this->pid_);
@@ -482,7 +482,7 @@ ActorImpl* ActorImpl::start(const simix::ActorCode& code)
   return this;
 }
 
-ActorImplPtr ActorImpl::create(std::string name, const simix::ActorCode& code, void* data, s4u::Host* host,
+ActorImplPtr ActorImpl::create(const std::string& name, const simix::ActorCode& code, void* data, s4u::Host* host,
                                std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor)
 {
   XBT_DEBUG("Start actor %s@'%s'", name.c_str(), host->get_cname());
@@ -726,12 +726,12 @@ void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(bool, voi
  * @param host where the new agent is executed.
  * @param properties the properties of the process
  */
-smx_actor_t simcall_process_create(std::string name, const simgrid::simix::ActorCode& code, void* data, sg_host_t host,
-                                   std::unordered_map<std::string, std::string>* properties)
+smx_actor_t simcall_process_create(const std::string& name, const simgrid::simix::ActorCode& code, void* data,
+                                   sg_host_t host, std::unordered_map<std::string, std::string>* properties)
 {
   smx_actor_t self = SIMIX_process_self();
-  return simgrid::simix::simcall([name, &code, data, host, properties, self] {
-    return simgrid::kernel::actor::ActorImpl::create(std::move(name), code, data, host, properties, self).get();
+  return simgrid::simix::simcall([&name, &code, data, host, properties, self] {
+    return simgrid::kernel::actor::ActorImpl::create(name, code, data, host, properties, self).get();
   });
 }
 
index 785e25b..994afa1 100644 (file)
@@ -34,7 +34,7 @@ class XBT_PUBLIC ActorImpl : public surf::PropertyHolder {
 
 public:
   xbt::string name_;
-  ActorImpl(xbt::string name, s4u::Host* host);
+  ActorImpl(const xbt::string& name, s4u::Host* host);
   ActorImpl(const ActorImpl&) = delete;
   ActorImpl& operator=(const ActorImpl&) = delete;
   ~ActorImpl();
@@ -106,12 +106,12 @@ public:
   s4u::ActorPtr iface() { return s4u::ActorPtr(&piface_); }
   s4u::Actor* ciface() { return &piface_; }
 
-  ActorImplPtr init(std::string name, s4u::Host* host);
+  ActorImplPtr init(const std::string& name, s4u::Host* host);
   ActorImpl* start(const simix::ActorCode& code);
 
-  static ActorImplPtr create(std::string name, const simix::ActorCode& code, void* data, s4u::Host* host,
+  static ActorImplPtr create(const std::string& name, const simix::ActorCode& code, void* data, s4u::Host* host,
                              std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor);
-  static ActorImplPtr attach(std::string name, void* data, s4u::Host* host,
+  static ActorImplPtr attach(const std::string& name, void* data, s4u::Host* host,
                              std::unordered_map<std::string, std::string>* properties);
   static void detach();
   void cleanup();
@@ -143,7 +143,7 @@ public:
   bool daemon_                                                             = false;
   ProcessArg()                                                             = default;
 
-  explicit ProcessArg(std::string name, const std::function<void()>& code, void* data, s4u::Host* host,
+  explicit ProcessArg(const std::string& name, const std::function<void()>& code, void* data, s4u::Host* host,
                       double kill_time, std::shared_ptr<std::unordered_map<std::string, std::string>> properties,
                       bool auto_restart)
       : name(name)
index c3c7820..bcb4782 100644 (file)
@@ -77,8 +77,9 @@ static std::map<std::string, std::string> smpi_colors = {{"recv", "1 0 0"},
   {"win_flush_local_all", "1 0 0.3"}
 };
 
-static const char* instr_find_color(std::string state)
+static const char* instr_find_color(const char* c_state)
 {
+  std::string state(c_state);
   boost::algorithm::to_lower(state);
   if (state.substr(0, 5) == "pmpi_")
     state = state.substr(5, std::string::npos); // Remove pmpi_ to allow for exact matches
@@ -135,7 +136,7 @@ static std::string TRACE_smpi_get_key(int src, int dst, int tag, int send)
 
 static std::unordered_map<smx_actor_t, std::string> process_category;
 
-void TRACE_internal_smpi_set_category(std::string category)
+void TRACE_internal_smpi_set_category(const std::string& category)
 {
   if (not TRACE_smpi_is_enabled())
     return;
@@ -144,7 +145,7 @@ void TRACE_internal_smpi_set_category(std::string category)
   TRACE_category(category.c_str());
 
   if (not category.empty())
-    process_category[SIMIX_process_self()] = std::move(category);
+    process_category[SIMIX_process_self()] = category;
 }
 
 std::string TRACE_internal_smpi_get_category()
index 3cc6249..c73ed55 100644 (file)
@@ -16,8 +16,8 @@ namespace app {
 
 class Instance {
 public:
-  Instance(std::string name, int max_no_processes, MPI_Comm comm, simgrid::s4u::Barrier* finalization_barrier)
-      : name(std::move(name))
+  Instance(const std::string& name, int max_no_processes, MPI_Comm comm, simgrid::s4u::Barrier* finalization_barrier)
+      : name(name)
       , size(max_no_processes)
       , present_processes(0)
       , comm_world(comm)
index 962f86e..39be42b 100644 (file)
@@ -22,11 +22,11 @@ const char* PropertyHolder::get_property(const std::string& key)
 }
 
 /** @brief Change the value of a given key in the property set */
-void PropertyHolder::set_property(const std::string& key, std::string value)
+void PropertyHolder::set_property(const std::string& key, const std::string& value)
 {
   if (not properties_)
     properties_ = new std::unordered_map<std::string, std::string>;
-  (*properties_)[key] = std::move(value);
+  (*properties_)[key] = value;
 }
 
 /** @brief Return the whole set of properties. Don't mess with it, dude! */
index 5f39e63..95d7987 100644 (file)
@@ -24,7 +24,7 @@ public:
   ~PropertyHolder();
 
   const char* get_property(const std::string& key);
-  void set_property(const std::string& id, std::string value);
+  void set_property(const std::string& id, const std::string& value);
 
   /* FIXME: This should not be exposed, as users may do bad things with the map they got (it's not a copy).
    * But some user API expose this call so removing it is not so easy.
index 55a31bd..7870a89 100644 (file)
@@ -35,14 +35,14 @@ StorageModel::~StorageModel()
  ************/
 
 StorageImpl::StorageImpl(kernel::resource::Model* model, const std::string& name, kernel::lmm::System* maxminSystem,
-                         double bread, double bwrite, std::string type_id, std::string content_name, sg_size_t size,
-                         std::string attach)
+                         double bread, double bwrite, const std::string& type_id, const std::string& content_name,
+                         sg_size_t size, const std::string& attach)
     : Resource(model, name, maxminSystem->constraint_new(this, std::max(bread, bwrite)))
     , piface_(name, this)
-    , typeId_(std::move(type_id))
-    , content_name(std::move(content_name))
+    , typeId_(type_id)
+    , content_name(content_name)
     , size_(size)
-    , attach_(std::move(attach))
+    , attach_(attach)
 {
   StorageImpl::turn_on();
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
index e3c508a..083c020 100644 (file)
@@ -55,8 +55,8 @@ public:
   StorageModel& operator=(const StorageModel&) = delete;
   ~StorageModel();
 
-  virtual StorageImpl* createStorage(std::string id, std::string type_id, std::string content_name,
-                                     std::string attach) = 0;
+  virtual StorageImpl* createStorage(const std::string& id, const std::string& type_id, const std::string& content_name,
+                                     const std::string& attach) = 0;
 };
 
 /************
@@ -70,7 +70,8 @@ class StorageImpl : public kernel::resource::Resource, public PropertyHolder {
 public:
   /** @brief Storage constructor */
   StorageImpl(kernel::resource::Model* model, const std::string& name, kernel::lmm::System* maxmin_system, double bread,
-              double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach);
+              double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
+              const std::string& attach);
   StorageImpl(const StorageImpl&) = delete;
   StorageImpl& operator=(const StorageImpl&) = delete;
 
@@ -172,15 +173,10 @@ public:
   std::unordered_map<std::string, std::string>* properties;
   std::unordered_map<std::string, std::string>* model_properties;
   sg_size_t size;
-  StorageType(std::string id, std::string model, std::string content,
+  StorageType(const std::string& id, const std::string& model, const std::string& content,
               std::unordered_map<std::string, std::string>* properties,
               std::unordered_map<std::string, std::string>* model_properties, sg_size_t size)
-      : id(std::move(id))
-      , model(std::move(model))
-      , content(std::move(content))
-      , properties(properties)
-      , model_properties(model_properties)
-      , size(size)
+      : id(id), model(model), content(content), properties(properties), model_properties(model_properties), size(size)
   {
   }
 };
index c67c9e6..4070803 100644 (file)
@@ -91,15 +91,15 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args)
 }
 
 /** @brief Add a "router" to the network element list */
-simgrid::kernel::routing::NetPoint* sg_platf_new_router(std::string name, const char* coords)
+simgrid::kernel::routing::NetPoint* sg_platf_new_router(const std::string& name, const char* coords)
 {
   if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
     current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::base;
   xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name),
              "Refusing to create a router named '%s': this name already describes a node.", name.c_str());
 
-  simgrid::kernel::routing::NetPoint* netpoint = new simgrid::kernel::routing::NetPoint(
-      std::move(name), simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
+  simgrid::kernel::routing::NetPoint* netpoint =
+      new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
   XBT_DEBUG("Router '%s' has the id %u", netpoint->get_cname(), netpoint->id());
 
   if (coords && strcmp(coords, ""))
index c91b47b..c13aa46 100644 (file)
@@ -46,8 +46,8 @@ StorageN11Model::StorageN11Model()
   all_existing_models.push_back(this);
 }
 
-StorageImpl* StorageN11Model::createStorage(std::string id, std::string type_id, std::string content_name,
-                                            std::string attach)
+StorageImpl* StorageN11Model::createStorage(const std::string& id, const std::string& type_id,
+                                            const std::string& content_name, const std::string& attach)
 {
   StorageType* storage_type = storage_types.at(type_id);
 
@@ -59,8 +59,8 @@ StorageImpl* StorageN11Model::createStorage(std::string id, std::string type_id,
   XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tBread '%f'\n", id.c_str(), type_id.c_str(),
             Bread);
 
-  return new StorageN11(this, std::move(id), get_maxmin_system(), Bread, Bwrite, std::move(type_id),
-                        std::move(content_name), storage_type->size, std::move(attach));
+  return new StorageN11(this, id, get_maxmin_system(), Bread, Bwrite, type_id, content_name, storage_type->size,
+                        attach);
 }
 
 double StorageN11Model::next_occuring_event(double now)
@@ -87,8 +87,9 @@ void StorageN11Model::update_actions_state(double /*now*/, double delta)
  * Resource *
  ************/
 
-StorageN11::StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
-                       double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach)
+StorageN11::StorageN11(StorageModel* model, const std::string& name, kernel::lmm::System* maxminSystem, double bread,
+                       double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
+                       const std::string& attach)
     : StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
 {
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
index e5fe5e3..6682708 100644 (file)
@@ -28,8 +28,8 @@ class XBT_PRIVATE StorageN11Action;
 class StorageN11Model : public StorageModel {
 public:
   StorageN11Model();
-  StorageImpl* createStorage(std::string id, std::string type_id, std::string content_name,
-                             std::string attach) override;
+  StorageImpl* createStorage(const std::string& id, const std::string& type_id, const std::string& content_name,
+                             const std::string& attach) override;
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 };
@@ -40,8 +40,9 @@ public:
 
 class StorageN11 : public StorageImpl {
 public:
-  StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread, double bwrite,
-             std::string type_id, std::string content_name, sg_size_t size, std::string attach);
+  StorageN11(StorageModel* model, const std::string& name, kernel::lmm::System* maxminSystem, double bread,
+             double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
+             const std::string& attach);
   virtual ~StorageN11() = default;
   StorageAction* io_start(sg_size_t size, s4u::Io::OpType type);
   StorageAction* read(sg_size_t size);
index 750de26..713cbee 100644 (file)
@@ -195,8 +195,8 @@ XBT_PUBLIC void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* li
 XBT_PUBLIC void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer);          // Add a peer      to the current Zone
 XBT_PUBLIC void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* clust);   // Add a cluster   to the current Zone
 XBT_PUBLIC void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet); // Add a cabinet   to the current Zone
-XBT_PUBLIC simgrid::kernel::routing::NetPoint*                      // Add a router    to the current Zone
-    sg_platf_new_router(std::string, const char* coords);
+XBT_PUBLIC simgrid::kernel::routing::NetPoint* // Add a router    to the current Zone
+    sg_platf_new_router(const std::string&, const char* coords);
 
 XBT_PUBLIC void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route);             // Add a route
 XBT_PUBLIC void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreationArgs* bypassroute); // Add a bypassRoute
index c69b636..762a5ec 100644 (file)
@@ -143,9 +143,9 @@ public:
   /* Callback */
   xbt_cfg_cb_t old_callback = nullptr;
 
-  ConfigurationElement(std::string key, std::string desc) : key(std::move(key)), desc(std::move(desc)) {}
-  ConfigurationElement(std::string key, std::string desc, xbt_cfg_cb_t cb)
-      : key(std::move(key)), desc(std::move(desc)), old_callback(cb)
+  ConfigurationElement(const std::string& key, const std::string& desc) : key(key), desc(desc) {}
+  ConfigurationElement(const std::string& key, const std::string& desc, xbt_cfg_cb_t cb)
+      : key(key), desc(desc), old_callback(cb)
   {
   }
 
@@ -184,14 +184,14 @@ private:
   std::function<void(T&)> callback;
 
 public:
-  TypedConfigurationElement(std::string key, std::string desc, T value = T())
-      : ConfigurationElement(std::move(key), std::move(desc)), content(std::move(value))
+  TypedConfigurationElement(const std::string& key, const std::string& desc, T value = T())
+      : ConfigurationElement(key, desc), content(std::move(value))
   {}
-  TypedConfigurationElement(std::string key, std::string desc, T value, xbt_cfg_cb_t cb)
-      : ConfigurationElement(std::move(key), std::move(desc), cb), content(std::move(value))
+  TypedConfigurationElement(const std::string& key, const std::string& desc, T value, xbt_cfg_cb_t cb)
+      : ConfigurationElement(key, desc, cb), content(std::move(value))
   {}
-  TypedConfigurationElement(std::string key, std::string desc, T value, std::function<void(T&)> callback)
-      : ConfigurationElement(std::move(key), std::move(desc)), content(std::move(value)), callback(std::move(callback))
+  TypedConfigurationElement(const std::string& key, const std::string& desc, T value, std::function<void(T&)> callback)
+      : ConfigurationElement(key, desc), content(std::move(value)), callback(std::move(callback))
   {}
   ~TypedConfigurationElement() = default;
 
@@ -403,8 +403,9 @@ void set_as_string(const char* name, const std::string& value)
   (*simgrid_config)[name].set_string_value(value.c_str());
 }
 
-void set_parse(std::string options)
+void set_parse(const std::string& opt)
 {
+  std::string options(opt);
   XBT_DEBUG("List to parse and set:'%s'", options.c_str());
   while (not options.empty()) {
     XBT_DEBUG("Still to parse and set: '%s'", options.c_str());
@@ -459,21 +460,21 @@ void alias(const char* realname, std::initializer_list<const char*> aliases)
 // ***** declare_flag *****
 
 template <class T>
-XBT_PUBLIC void declare_flag(const std::string& name, std::string description, T value,
+XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, T value,
                              std::function<void(const T&)> callback)
 {
   if (simgrid_config == nullptr)
     simgrid_config = new simgrid::config::Config();
-  simgrid_config->register_option<T>(name, std::move(description), std::move(value), std::move(callback));
+  simgrid_config->register_option<T>(name, description, std::move(value), std::move(callback));
 }
 
-template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, int value,
+template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, int value,
                                       std::function<void(int const&)> callback);
-template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, double value,
+template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, double value,
                                       std::function<void(double const&)> callback);
-template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, bool value,
+template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, bool value,
                                       std::function<void(bool const&)> callback);
-template XBT_PUBLIC void declare_flag(const std::string& name, std::string description, std::string value,
+template XBT_PUBLIC void declare_flag(const std::string& name, const std::string& description, std::string value,
                                       std::function<void(std::string const&)> callback);
 
 void finalize()
index ef5cb90..03294d0 100644 (file)
@@ -39,7 +39,7 @@ static int computation_fun(std::vector<std::string> argv)
   return 0;
 }
 
-static void run_test_process(std::string name, simgrid::s4u::Host *location, int size)
+static void run_test_process(const std::string& name, simgrid::s4u::Host* location, int size)
 {
   std::vector<std::string> arg = {std::to_string(size)};
   simgrid::s4u::Actor::create(std::move(name), location, computation_fun, arg);