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
woops, stupid ugly typo
[simgrid.git]
/
src
/
s4u
/
s4u_netzone.cpp
diff --git
a/src/s4u/s4u_netzone.cpp
b/src/s4u/s4u_netzone.cpp
index
22889ef
..
e4f6989
100644
(file)
--- a/
src/s4u/s4u_netzone.cpp
+++ b/
src/s4u/s4u_netzone.cpp
@@
-61,7
+61,7
@@
void NetZone::setProperty(const char* key, const char* value)
/** @brief Returns the list of direct children (no grand-children)
*
/** @brief Returns the list of direct children (no grand-children)
*
- * This function returns the internal copy of the children
s
, not a copy. Don't mess with it!
+ * This function returns the internal copy of the children, not a copy. Don't mess with it!
*/
std::vector<NetZone*>* NetZone::getChildren()
{
*/
std::vector<NetZone*>* NetZone::getChildren()
{
@@
-86,6
+86,17
@@
void NetZone::getHosts(std::vector<s4u::Host*>* whereto)
}
}
}
}
+int NetZone::getHostCount()
+{
+ int count = 0;
+ for (auto const& card : vertices_) {
+ s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->getName());
+ if (host != nullptr)
+ count++;
+ }
+ return count;
+}
+
int NetZone::addComponent(kernel::routing::NetPoint* elm)
{
vertices_.push_back(elm);
int NetZone::addComponent(kernel::routing::NetPoint* elm)
{
vertices_.push_back(elm);