// this hpp is exported to the users and so cannot include the other internal hpp.
class LinkDeleter {
public:
- void operator()(resource::StandardLinkImpl* link);
+ void operator()(resource::StandardLinkImpl* link) const;
};
std::map<std::string, std::unique_ptr<resource::StandardLinkImpl, LinkDeleter>, std::less<>> links_;
/* save split-duplex links separately, keep links_ with only LinkImpl* seen by the user
XBT_DEBUG("Create link '%s'", name.c_str());
}
-void StandardLinkImpl::Deleter::operator()(resource::StandardLinkImpl* link)
+void StandardLinkImpl::Deleter::operator()(resource::StandardLinkImpl* link) const
{
link->destroy();
}
void destroy(); // Must be called instead of the destructor
class Deleter {
public:
- void operator()(StandardLinkImpl* link);
+ void operator()(StandardLinkImpl* link) const;
};
void latency_check(double latency) const;
std::vector<kernel::resource::StandardLinkImpl*> const& link_list)>
NetZoneImpl::on_route_creation;
-void NetZoneImpl::LinkDeleter::operator()(resource::StandardLinkImpl* link)
+void NetZoneImpl::LinkDeleter::operator()(resource::StandardLinkImpl* link) const
{
link->destroy();
}
std::vector<s4u::Link*> NetZoneImpl::get_all_links() const
{
- return get_filtered_links([](s4u::Link*) { return true; });
+ return get_filtered_links([](const s4u::Link*) { return true; });
}
size_t NetZoneImpl::get_link_count() const
/** @brief Returns the list of all links found in the platform */
std::vector<Link*> Engine::get_all_links() const
{
- return get_filtered_links([](Link*) { return true; });
+ return get_filtered_links([](const Link*) { return true; });
}
std::vector<Link*> Engine::get_filtered_links(const std::function<bool(Link*)>& filter) const