X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8b97d550e0d00e3bb7a493914eba02027881b915..66ce7b65c80f339faa39a416fdf9de0ee4017293:/include/simgrid/s4u/Link.hpp diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index 04100c16d6..84fffebcc4 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -36,8 +36,8 @@ public: kernel::resource::LinkImpl* get_impl() { return pimpl_; } /** @brief Retrieve a link from its name */ - static Link* by_name(std::string name); - static Link* by_name_or_null(std::string name); + static Link* by_name(const std::string& name); + static Link* by_name_or_null(const std::string& name); /** @brief Retrieves the name of that link as a C++ string */ const std::string& get_name() const; @@ -60,6 +60,7 @@ public: bool is_used(); void turn_on(); + bool is_on() const; void turn_off(); void* get_data(); /** Should be used only from the C interface. Prefer extensions in C++ */ @@ -92,8 +93,8 @@ public: * The profile must contain absolute values */ void set_latency_profile(kernel::profile::Profile* profile); - const char* get_property(std::string key); - void set_property(std::string key, std::string value); + const char* get_property(const std::string& key); + void set_property(const std::string& key, const std::string& value); /* The signals */ /** @brief Callback signal fired when a new Link is created */ @@ -142,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();}