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
hopefully fix most issues. thx agier for spotting the main one
[simgrid.git]
/
src
/
s4u
/
s4u_Storage.cpp
diff --git
a/src/s4u/s4u_Storage.cpp
b/src/s4u/s4u_Storage.cpp
index
799240f
..
78cfaf6
100644
(file)
--- a/
src/s4u/s4u_Storage.cpp
+++ b/
src/s4u/s4u_Storage.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2006-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-201
9
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-21,17
+21,17
@@
simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_creation;
simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_destruction;
simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_state_change;
simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_destruction;
simgrid::xbt::signal<void(s4u::Storage&)> Storage::on_state_change;
-Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(
name
)
+Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(
std::move(name)
)
{
{
- simgrid::s4u::Engine::get_instance()->storage_register(name, this);
+ simgrid::s4u::Engine::get_instance()->storage_register(name
_
, this);
}
}
-Storage* Storage::by_name(
std::string
name)
+Storage* Storage::by_name(
const std::string&
name)
{
return Engine::get_instance()->storage_by_name(name);
}
{
return Engine::get_instance()->storage_by_name(name);
}
-Storage* Storage::by_name_or_null(
std::string
name)
+Storage* Storage::by_name_or_null(
const std::string&
name)
{
return Engine::get_instance()->storage_by_name_or_null(name);
}
{
return Engine::get_instance()->storage_by_name_or_null(name);
}
@@
-46,51
+46,40
@@
std::unordered_map<std::string, std::string>* Storage::get_properties()
return simgrid::simix::simcall([this] { return pimpl_->get_properties(); });
}
return simgrid::simix::simcall([this] { return pimpl_->get_properties(); });
}
-const char* Storage::get_property(
std::string
key)
+const char* Storage::get_property(
const std::string&
key)
{
return this->pimpl_->get_property(key);
}
{
return this->pimpl_->get_property(key);
}
-void Storage::set_property(
std::string
key, std::string value)
+void Storage::set_property(
const std::string&
key, std::string value)
{
simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
}
IoPtr Storage::io_init(sg_size_t size, Io::OpType type)
{
{
simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
}
IoPtr Storage::io_init(sg_size_t size, Io::OpType type)
{
- IoPtr res = IoPtr(new Io(size, type));
- res->storage_ = this;
- return res;
+ return IoPtr(new Io(this, size, type));
}
IoPtr Storage::read_async(sg_size_t size)
{
}
IoPtr Storage::read_async(sg_size_t size)
{
-
- IoPtr res = io_init(size, Io::OpType::READ);
- res->start();
- return res;
+ return IoPtr(io_init(size, Io::OpType::READ))->start();
}
sg_size_t Storage::read(sg_size_t size)
{
}
sg_size_t Storage::read(sg_size_t size)
{
- IoPtr i = io_init(size, Io::OpType::READ);
- i->start()->wait();
- return i->get_performed_ioops();
+ return IoPtr(io_init(size, Io::OpType::READ))->start()->wait()->get_performed_ioops();
}
IoPtr Storage::write_async(sg_size_t size)
{
}
IoPtr Storage::write_async(sg_size_t size)
{
- IoPtr res = io_init(size, Io::OpType::WRITE);
- res->start();
- return res;
+ return IoPtr(io_init(size, Io::OpType::WRITE)->start());
}
sg_size_t Storage::write(sg_size_t size)
{
}
sg_size_t Storage::write(sg_size_t size)
{
- IoPtr i = io_init(size, Io::OpType::WRITE);
- i->start()->wait();
- return i->get_performed_ioops();
+ return IoPtr(io_init(size, Io::OpType::WRITE))->start()->wait()->get_performed_ioops();
}
} /* namespace s4u */
}
} /* namespace s4u */