-/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2020. 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. */
#include "src/surf/network_interface.hpp"
#include "xbt/log.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_link, s4u, "Logging specific to the S4U links");
-
namespace simgrid {
+
+template class xbt::Extendable<s4u::Link>;
+
namespace s4u {
xbt::signal<void(Link&)> Link::on_creation;
{
return this->pimpl_->get_cname();
}
-bool Link::is_used()
+bool Link::is_used() const
{
return this->pimpl_->is_used();
}
return this->pimpl_->get_bandwidth();
}
-Link::SharingPolicy Link::get_sharing_policy()
+Link::SharingPolicy Link::get_sharing_policy() const
{
return this->pimpl_->get_sharing_policy();
}
-double Link::get_usage()
+double Link::get_usage() const
{
return this->pimpl_->get_constraint()->get_usage();
}
/* **************************** Public C interface *************************** */
-const char* sg_link_name(sg_link_t link)
+const char* sg_link_name(const_sg_link_t link)
{
return link->get_cname();
}
return simgrid::s4u::Link::by_name(name);
}
-int sg_link_is_shared(sg_link_t link)
+int sg_link_is_shared(const_sg_link_t link)
{
return (int)link->get_sharing_policy();
}
-double sg_link_bandwidth(sg_link_t link)
+double sg_link_bandwidth(const_sg_link_t link)
{
return link->get_bandwidth();
}
-double sg_link_latency(sg_link_t link)
+double sg_link_latency(const_sg_link_t link)
{
return link->get_latency();
}
-void* sg_link_data(sg_link_t link)
+void* sg_link_data(const_sg_link_t link)
{
return link->get_data();
}