X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/76c70a751b2ef94044ccb57c6c9cff83e0aec728..ebc355d0c96552d0bc2aa301d90723490337bca3:/src/s4u/s4u_Link.cpp diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index a49d92dcb6..99d994ef1a 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -23,14 +23,15 @@ simgrid::xbt::signal Link::on_destruction; simgrid::xbt::signal Link::on_state_change; simgrid::xbt::signal Link::on_bandwidth_change; simgrid::xbt::signal Link::on_communicate; -simgrid::xbt::signal Link::on_communication_state_change; +simgrid::xbt::signal + Link::on_communication_state_change; -Link* Link::by_name(std::string name) +Link* Link::by_name(const std::string& name) { return Engine::get_instance()->link_by_name(name); } -Link* Link::by_name_or_null(std::string name) +Link* Link::by_name_or_null(const std::string& name) { return Engine::get_instance()->link_by_name_or_null(name); } @@ -77,6 +78,11 @@ void Link::turn_off() simgrid::simix::simcall([this]() { this->pimpl_->turn_off(); }); } +bool Link::is_on() const +{ + return this->pimpl_->is_on(); +} + void* Link::get_data() { return this->pimpl_->get_data(); @@ -86,26 +92,26 @@ void Link::set_data(void* d) simgrid::simix::simcall([this, d]() { this->pimpl_->set_data(d); }); } -void Link::set_state_trace(tmgr_trace_t trace) +void Link::set_state_profile(kernel::profile::Profile* profile) { - simgrid::simix::simcall([this, trace]() { this->pimpl_->set_state_trace(trace); }); + simgrid::simix::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); }); } -void Link::set_bandwidth_trace(tmgr_trace_t trace) +void Link::set_bandwidth_profile(kernel::profile::Profile* profile) { - simgrid::simix::simcall([this, trace]() { this->pimpl_->set_bandwidth_trace(trace); }); + simgrid::simix::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); }); } -void Link::set_latency_trace(tmgr_trace_t trace) +void Link::set_latency_profile(kernel::profile::Profile* trace) { - simgrid::simix::simcall([this, trace]() { this->pimpl_->set_latency_trace(trace); }); + simgrid::simix::simcall([this, trace]() { this->pimpl_->set_latency_profile(trace); }); } -const char* Link::get_property(const char* key) +const char* Link::get_property(const std::string& key) { return this->pimpl_->get_property(key); } -void Link::set_property(std::string key, std::string value) +void Link::set_property(const std::string& key, const std::string& value) { - simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); }); + simgrid::simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); }); } } // namespace s4u } // namespace simgrid