A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into depencencies
[simgrid.git]
/
src
/
s4u
/
s4u_Link.cpp
diff --git
a/src/s4u/s4u_Link.cpp
b/src/s4u/s4u_Link.cpp
index
4fecbd4
..
4942e65
100644
(file)
--- a/
src/s4u/s4u_Link.cpp
+++ b/
src/s4u/s4u_Link.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2013-20
19
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-20
20
. 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. */
/* 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. */
@@
-13,9
+13,10
@@
#include "src/surf/network_interface.hpp"
#include "xbt/log.h"
#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 {
namespace simgrid {
+
+template class xbt::Extendable<s4u::Link>;
+
namespace s4u {
xbt::signal<void(Link&)> Link::on_creation;
namespace s4u {
xbt::signal<void(Link&)> Link::on_creation;
@@
-44,7
+45,7
@@
const char* Link::get_cname() const
{
return this->pimpl_->get_cname();
}
{
return this->pimpl_->get_cname();
}
-bool Link::is_used()
+bool Link::is_used()
const
{
return this->pimpl_->is_used();
}
{
return this->pimpl_->is_used();
}
@@
-59,12
+60,12
@@
double Link::get_bandwidth() const
return this->pimpl_->get_bandwidth();
}
return this->pimpl_->get_bandwidth();
}
-Link::SharingPolicy Link::get_sharing_policy()
+Link::SharingPolicy Link::get_sharing_policy()
const
{
return this->pimpl_->get_sharing_policy();
}
{
return this->pimpl_->get_sharing_policy();
}
-double Link::get_usage()
+double Link::get_usage()
const
{
return this->pimpl_->get_constraint()->get_usage();
}
{
return this->pimpl_->get_constraint()->get_usage();
}
@@
-83,15
+84,6
@@
bool Link::is_on() const
return this->pimpl_->is_on();
}
return this->pimpl_->is_on();
}
-void* Link::get_data()
-{
- return this->pimpl_->get_data();
-}
-void Link::set_data(void* d)
-{
- simgrid::kernel::actor::simcall([this, d]() { this->pimpl_->set_data(d); });
-}
-
void Link::set_state_profile(kernel::profile::Profile* profile)
{
simgrid::kernel::actor::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
void Link::set_state_profile(kernel::profile::Profile* profile)
{
simgrid::kernel::actor::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
@@
-118,7
+110,7
@@
void Link::set_property(const std::string& key, const std::string& value)
/* **************************** Public C interface *************************** */
/* **************************** 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 link->get_cname();
}
@@
-127,19
+119,19
@@
sg_link_t sg_link_by_name(const char* name)
return simgrid::s4u::Link::by_name(name);
}
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();
}
{
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();
}
{
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();
}
{
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();
}
{
return link->get_data();
}