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
[s4u] Use const& references in Host::mounted_storages()
[simgrid.git]
/
examples
/
s4u
/
io
/
s4u_io_test.cpp
diff --git
a/examples/s4u/io/s4u_io_test.cpp
b/examples/s4u/io/s4u_io_test.cpp
index
eee4303
..
c2e9757
100644
(file)
--- a/
examples/s4u/io/s4u_io_test.cpp
+++ b/
examples/s4u/io/s4u_io_test.cpp
@@
-16,12
+16,13
@@
public:
myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
: simgrid::s4u::Actor(procname,host,argc,argv){}
myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
: simgrid::s4u::Actor(procname,host,argc,argv){}
- void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage &> &mounts) {
- XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->name());
+ void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage*> const&mounts) {
+ XBT_INFO("Storage info on %s:",
+ simgrid::s4u::Host::current()->name().c_str());
for (const auto&kv : mounts) {
const char* mountpoint = kv.first.c_str();
for (const auto&kv : mounts) {
const char* mountpoint = kv.first.c_str();
- simgrid::s4u::Storage &storage = kv.second;
+ simgrid::s4u::Storage &storage =
*
kv.second;
// Retrieve disk's information
sg_size_t free_size = storage.size_free();
// Retrieve disk's information
sg_size_t free_size = storage.size_free();
@@
-34,8
+35,8
@@
public:
}
int main(int argc, char **argv) {
}
int main(int argc, char **argv) {
- boost::unordered_map <std::string, simgrid::s4u::Storage
&> &
mounts =
- simgrid::s4u::Host::current()->mounted
S
torages();
+ boost::unordered_map <std::string, simgrid::s4u::Storage
*> const&
mounts =
+ simgrid::s4u::Host::current()->mounted
_s
torages();
show_info(mounts);
show_info(mounts);
@@
-108,7
+109,7
@@
int main(int argc, char **argv) {
simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
e->loadPlatform("../../platforms/storage/storage.xml");
simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
e->loadPlatform("../../platforms/storage/storage.xml");
- new myHost("host", simgrid::s4u::Host::by
N
ame("denise"), 0, NULL);
+ new myHost("host", simgrid::s4u::Host::by
_n
ame("denise"), 0, NULL);
e->run();
return 0;
}
e->run();
return 0;
}