X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e709643ef0c5b61c6c878016c418bffa2b1b20cd..50102ec1c30562e20d450afa7015374387bf1904:/src/surf/network_interface.cpp diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 764c414c75..8084ae54bb 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -59,7 +59,7 @@ double NetworkModel::next_occurring_event_full(double now) double minRes = Model::next_occurring_event_full(now); for (Action const& action : *get_started_action_set()) { - const NetworkAction& net_action = static_cast(action); + const auto& net_action = static_cast(action); if (net_action.latency_ > 0) minRes = (minRes < 0) ? net_action.latency_ : std::min(minRes, net_action.latency_); } @@ -104,22 +104,22 @@ void LinkImpl::destroy() } } -bool LinkImpl::is_used() +bool LinkImpl::is_used() const { return get_model()->get_maxmin_system()->constraint_used(get_constraint()); } -double LinkImpl::get_latency() +double LinkImpl::get_latency() const { return latency_.peak * latency_.scale; } -double LinkImpl::get_bandwidth() +double LinkImpl::get_bandwidth() const { return bandwidth_.peak * bandwidth_.scale; } -s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() +s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() const { return get_constraint()->get_sharing_policy(); } @@ -190,7 +190,7 @@ std::list NetworkAction::get_links() const /* Beware of composite actions: ptasks put links and cpus together */ // extra pb: we cannot dynamic_cast from void*... Resource* resource = get_variable()->get_constraint(i)->get_id(); - LinkImpl* link = dynamic_cast(resource); + auto* link = dynamic_cast(resource); if (link != nullptr) retlist.push_back(link); }