Message(const std::string& sender_, int size_) : sender(sender_), size(size_) {}
};
-static void sender(std::string mailbox, double msg_size, unsigned sleep_time)
+static void sender(const std::string& mailbox, double msg_size, unsigned sleep_time)
{
simgrid::s4u::this_actor::sleep_for(sleep_time);
auto* mbox = simgrid::s4u::Mailbox::by_name(mailbox);
mbox->put(msg, msg_size);
}
-static void receiver(std::string mailbox)
+static void receiver(const std::string& mailbox)
{
auto* mbox = simgrid::s4u::Mailbox::by_name(mailbox);
auto msg = mbox->get_unique<Message>();
for (auto const& kv : *hostprops)
keys.push_back(kv.first);
std::sort(keys.begin(), keys.end());
- for (std::string key : keys)
+ for (const std::string& key : keys)
XBT_INFO(" Host property: '%s' -> '%s'", key.c_str(), hostprops->at(key).c_str());
XBT_INFO("== Try to get a host property that does not exist");
for (auto const& kv : *zoneprops)
keys.push_back(kv.first);
std::sort(keys.begin(), keys.end());
- for (std::string key : keys)
+ for (const std::string& key : keys)
XBT_INFO(" Zone property: '%s' -> '%s'", key.c_str(), zoneprops->at(key).c_str());
}
static simgrid::config::Flag<std::string> ns3_seed(
"ns3/seed",
"The random seed provided to ns-3. Either 'time' to seed with time(), blank to not set (default), or a number.", "",
- [](std::string val) {
+ [](const std::string& val) {
if (val.length() == 0)
return;
if (strcasecmp(val.c_str(), "time") == 0) {
keys.push_back(kv.first);
}
std::sort(keys.begin(), keys.end());
- for (std::string key : keys) {
+ for (const std::string& key : keys) {
if (simgrid::config::is_default(key.c_str())) {
std::string cfg = key + ":" + current_property_set.at(key);
simgrid::config::set_parse(cfg);