1 /* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SIMGRID_KERNEL_RESOURCE_LINKIMPLINTF_HPP
7 #define SIMGRID_KERNEL_RESOURCE_LINKIMPLINTF_HPP
9 #include "simgrid/s4u/Link.hpp"
10 #include "src/kernel/resource/Resource.hpp"
11 #include "xbt/PropertyHolder.hpp"
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)
27 class LinkImplIntf : public Resource_T<LinkImplIntf>, public xbt::PropertyHolder {
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;
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;
40 /** @brief The sharing policy */
41 virtual void set_sharing_policy(s4u::Link::SharingPolicy policy, const s4u::NonLinearResourceCb& cb) = 0;
42 virtual s4u::Link::SharingPolicy get_sharing_policy() const = 0;
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;
54 } // namespace resource
56 } // namespace simgrid
58 #endif /* SIMGRID_KERNEL_RESOURCE_LINKIMPLINTF_HPP */