X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f1e469ce075c0a1ad21a7fd0fdb587f9a3cb5289..a4eb5efea24b01bda48fb4dc7c7600de78b4578b:/src/s4u/s4u_netzone.cpp diff --git a/src/s4u/s4u_netzone.cpp b/src/s4u/s4u_netzone.cpp index 17035d2189..33dbf91c0a 100644 --- a/src/s4u/s4u_netzone.cpp +++ b/src/s4u/s4u_netzone.cpp @@ -20,6 +20,8 @@ simgrid::xbt::signal* link_list)> NetZone::onRouteCreation; +simgrid::xbt::signal NetZone::onCreation; +simgrid::xbt::signal NetZone::onSeal; NetZone::NetZone(NetZone* father, const char* name) : father_(father), name_(xbt_strdup(name)) { @@ -39,7 +41,7 @@ NetZone::~NetZone() xbt_free(name_); } -std::unordered_map* NetZone::properties() +std::unordered_map* NetZone::getProperties() { return simgrid::simix::kernelImmediate([this] { return &properties_; @@ -47,7 +49,7 @@ std::unordered_map* NetZone::properties() } /** Retrieve the property value (or nullptr if not set) */ -const char* NetZone::property(const char* key) +const char* NetZone::getProperty(const char* key) { return properties_.at(key).c_str(); } @@ -58,28 +60,26 @@ void NetZone::setProperty(const char* key, const char* value) }); } -std::vector* NetZone::children() +std::vector* NetZone::getChildren() { return children_; } -char* NetZone::name() +char* NetZone::getCname() { return name_; } -NetZone* NetZone::father() +NetZone* NetZone::getFather() { return father_; } -std::vector* NetZone::hosts() +void NetZone::getHosts(std::vector* whereto) { - if (hosts_.empty()) // Lazy initialization - for (auto card : vertices_) { - s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name()); - if (host != nullptr) - hosts_.push_back(host); - } - return &hosts_; + for (auto card : vertices_) { + s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name()); + if (host != nullptr) + whereto->push_back(host); + } } int NetZone::addComponent(kernel::routing::NetPoint* elm)