1 /* Copyright (c) 2013-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 #include "src/surf/SplitDuplexLinkImpl.hpp"
8 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
18 SplitDuplexLinkImpl::SplitDuplexLinkImpl(const std::string& name, LinkImpl* link_up, LinkImpl* link_down)
19 : LinkImplIntf(name), piface_(this), link_up_(link_up), link_down_(link_down)
23 bool SplitDuplexLinkImpl::is_used() const
25 xbt_die("Impossible to call is_used() in split-duplex links. Call it for each individual link.");
28 void SplitDuplexLinkImpl::set_sharing_policy(s4u::Link::SharingPolicy policy)
30 xbt_die("Impossible to change sharing policy of split-duplex links");
33 void SplitDuplexLinkImpl::set_bandwidth(double value)
35 link_up_->set_bandwidth(value);
36 link_down_->set_bandwidth(value);
39 void SplitDuplexLinkImpl::set_latency(double value)
41 link_up_->set_latency(value);
42 link_down_->set_latency(value);
45 void SplitDuplexLinkImpl::turn_on()
48 link_down_->turn_on();
51 void SplitDuplexLinkImpl::turn_off()
54 link_down_->turn_off();
57 void SplitDuplexLinkImpl::apply_event(profile::Event* event, double value)
59 link_up_->apply_event(event, value);
60 link_down_->apply_event(event, value);
63 void SplitDuplexLinkImpl::seal()
74 void SplitDuplexLinkImpl::set_bandwidth_profile(profile::Profile* profile)
76 link_up_->set_bandwidth_profile(profile);
77 link_down_->set_bandwidth_profile(profile);
80 void SplitDuplexLinkImpl::set_latency_profile(profile::Profile* profile)
82 link_up_->set_latency_profile(profile);
83 link_down_->set_latency_profile(profile);
86 void SplitDuplexLinkImpl::set_concurrency_limit(int limit) const
88 link_up_->set_concurrency_limit(limit);
89 link_down_->set_concurrency_limit(limit);
92 } // namespace resource
94 } // namespace simgrid