Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to set a concurrency limit on disks and hosts
[simgrid.git] / src / kernel / resource / LinkImpl.hpp
1 /* Copyright (c) 2004-2023. 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_LINKIMPL_HPP
7 #define SIMGRID_KERNEL_RESOURCE_LINKIMPL_HPP
8
9 #include "simgrid/s4u/Link.hpp"
10 #include "src/kernel/resource/Resource.hpp"
11 #include "xbt/PropertyHolder.hpp"
12
13 namespace simgrid::kernel::resource {
14
15 /************
16  * Resource *
17  ************/
18 class LinkImpl : public Resource_T<LinkImpl>, public xbt::PropertyHolder {
19 public:
20   using Resource_T::Resource_T;
21   /** @brief Get the bandwidth in bytes per second of current Link */
22   virtual double get_bandwidth() const = 0;
23   /** @brief Update the bandwidth in bytes per second of current Link */
24   virtual void set_bandwidth(double value) = 0;
25
26   /** @brief Get the latency in seconds of current Link */
27   virtual double get_latency() const = 0;
28   /** @brief Update the latency in seconds of current Link */
29   virtual void set_latency(double value) = 0;
30
31   /** @brief The sharing policy */
32   virtual void set_sharing_policy(s4u::Link::SharingPolicy policy, const s4u::NonLinearResourceCb& cb) = 0;
33   virtual s4u::Link::SharingPolicy get_sharing_policy() const                                          = 0;
34
35   /* setup the profile file with bandwidth events (peak speed changes due to external load).
36    * Profile must contain percentages (value between 0 and 1). */
37   virtual void set_bandwidth_profile(kernel::profile::Profile* profile) = 0;
38   /* setup the profile file with latency events (peak latency changes due to external load).
39    * Profile must contain absolute values */
40   virtual void set_latency_profile(kernel::profile::Profile* profile) = 0;
41 };
42
43 } // namespace simgrid::kernel::resource
44
45 #endif /* SIMGRID_KERNEL_RESOURCE_LINKIMPL_HPP */