Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Split-Duplex: new management
[simgrid.git] / src / surf / LinkImplIntf.hpp
1 /* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_KERNEL_RESOURCE_LINKIMPLINTF_HPP
7 #define SIMGRID_KERNEL_RESOURCE_LINKIMPLINTF_HPP
8
9 #include "simgrid/kernel/resource/Resource.hpp"
10 #include "simgrid/s4u/Link.hpp"
11 #include <xbt/PropertyHolder.hpp>
12
13 /***********
14  * Classes *
15  ***********/
16
17 namespace simgrid {
18 namespace kernel {
19 namespace resource {
20 /************
21  * Resource *
22  ************/
23 /** @ingroup SURF_interface
24  * @brief SURF network link interface class
25  * @details A Link represents the link between two [hosts](@ref simgrid::surf::HostImpl)
26  */
27 class LinkImplIntf : public Resource_T<LinkImplIntf>, public xbt::PropertyHolder {
28 public:
29   using Resource_T::Resource_T;
30   /** @brief Get the bandwidth in bytes per second of current Link */
31   virtual double get_bandwidth() const = 0;
32   /** @brief Update the bandwidth in bytes per second of current Link */
33   virtual void set_bandwidth(double value) = 0;
34
35   /** @brief Get the latency in seconds of current Link */
36   virtual double get_latency() const = 0;
37   /** @brief Update the latency in seconds of current Link */
38   virtual void set_latency(double value) = 0;
39
40   /** @brief The sharing policy */
41   virtual void set_sharing_policy(s4u::Link::SharingPolicy policy) = 0;
42   virtual s4u::Link::SharingPolicy get_sharing_policy() const      = 0;
43
44   /* setup the profile file with bandwidth events (peak speed changes due to external load).
45    * Profile must contain percentages (value between 0 and 1). */
46   virtual void set_bandwidth_profile(kernel::profile::Profile* profile) = 0;
47   /* setup the profile file with latency events (peak latency changes due to external load).
48    * Profile must contain absolute values */
49   virtual void set_latency_profile(kernel::profile::Profile* profile) = 0;
50   /** @brief Set the concurrency limit for this link */
51   virtual void set_concurrency_limit(int limit) const = 0;
52 };
53
54 } // namespace resource
55 } // namespace kernel
56 } // namespace simgrid
57
58 #endif /* SIMGRID_KERNEL_RESOURCE_LINKIMPLINTF_HPP */