Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case s4u::Activity
[simgrid.git] / include / simgrid / s4u / Link.hpp
index 120989b..9857e6c 100644 (file)
@@ -30,6 +30,8 @@ class XBT_PUBLIC Link : public simgrid::xbt::Extendable<Link> {
   kernel::resource::LinkImpl* const pimpl_;
 
 public:
+  enum class SharingPolicy { SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
+
   /** @brief Retrieve a link from its name */
   static Link* by_name(const char* name);
 
@@ -38,10 +40,7 @@ public:
   /** @brief Retrieves the name of that link as a C string */
   const char* get_cname() const;
 
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::by_name()") static Link* byName(const char* name)
-  {
-    return by_name(name);
-  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Link::by_name()") static Link* byName(const char* name) { return by_name(name); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_name()") const std::string& getName() const { return get_name(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_cname()") const char* getCname() const { return get_cname(); }
 
@@ -53,7 +52,7 @@ public:
 
   /** @brief The sharing policy is a @{link e_surf_link_sharing_policy_t::EType} (0: FATPIPE, 1: SHARED, 2: SPLITDUPLEX)
    */
-  int sharingPolicy();
+  SharingPolicy sharingPolicy();
 
   /** @brief Returns the current load (in flops per second) */
   double getUsage();