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
Move collective algorithms to separate folders
[simgrid.git]
/
src
/
s4u
/
s4u_engine.cpp
diff --git
a/src/s4u/s4u_engine.cpp
b/src/s4u/s4u_engine.cpp
index
b872ca4
..
bcb1820
100644
(file)
--- a/
src/s4u/s4u_engine.cpp
+++ b/
src/s4u/s4u_engine.cpp
@@
-23,7
+23,9
@@
XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
namespace simgrid {
namespace s4u {
namespace simgrid {
namespace s4u {
-xbt::signal<void(void)> onPlatformCreated;
+xbt::signal<void()> onPlatformCreated;
+xbt::signal<void()> onSimulationEnd;
+xbt::signal<void(double)> onTimeAdvance;
Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
@@
-95,13
+97,11
@@
static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* n
if(!strcmp(current->name(), name))
return current;
if(!strcmp(current->name(), name))
return current;
- xbt_dict_cursor_t cursor = nullptr;
- char *key;
- NetZone_t elem;
- xbt_dict_foreach(current->children(), cursor, key, elem) {
+ for (auto elem : *(current->children())) {
simgrid::s4u::NetZone* tmp = netzoneByNameRecursive(elem, name);
simgrid::s4u::NetZone* tmp = netzoneByNameRecursive(elem, name);
- if (tmp != nullptr )
- return tmp;
+ if (tmp != nullptr) {
+ return tmp;
+ }
}
return nullptr;
}
}
return nullptr;
}
@@
-135,7
+135,7
@@
void Engine::netpointRegister(simgrid::kernel::routing::NetPoint* point)
/** @brief Unregister a given netpoint */
void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
{
/** @brief Unregister a given netpoint */
void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
{
- simgrid::simix::kernelImmediate([
&
] {
+ simgrid::simix::kernelImmediate([
this, point
] {
pimpl->netpoints_.erase(point->name());
delete point;
});
pimpl->netpoints_.erase(point->name());
delete point;
});