X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/914a96cd544e878a5c2513b800d2327f86ef9119..1bd1bbd35034c2e93a030a676dc244ad2cf74c70:/src/s4u/s4u_storage.cpp diff --git a/src/s4u/s4u_storage.cpp b/src/s4u/s4u_storage.cpp index c3066bd3a6..5cb09af9e0 100644 --- a/src/s4u/s4u_storage.cpp +++ b/src/s4u/s4u_storage.cpp @@ -3,10 +3,10 @@ /* 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. */ -#include "../surf/StorageImpl.hpp" #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/Storage.hpp" #include "simgrid/simix.hpp" +#include "src/surf/StorageImpl.hpp" #include namespace simgrid { @@ -60,6 +60,11 @@ sg_size_t Storage::getSizeUsed() return simgrid::simix::kernelImmediate([this] { return pimpl_->getUsedSize(); }); } +void Storage::decrUsedSize(sg_size_t size) +{ + simgrid::simix::kernelImmediate([this, size] { pimpl_->usedSize_ -= size; }); +} + sg_size_t Storage::getSize() { return pimpl_->getSize(); @@ -70,12 +75,12 @@ std::map* Storage::getProperties() return simgrid::simix::kernelImmediate([this] { return pimpl_->getProperties(); }); } -const char* Storage::getProperty(const char* key) +const char* Storage::getProperty(std::string key) { return this->pimpl_->getProperty(key); } -void Storage::setProperty(const char* key, const char* value) +void Storage::setProperty(std::string key, std::string value) { simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); }); } @@ -85,6 +90,16 @@ std::map* Storage::getContent() return simgrid::simix::kernelImmediate([this] { return pimpl_->getContent(); }); } +sg_size_t Storage::read(sg_size_t size) +{ + return simcall_storage_read(pimpl_, size); +} + +sg_size_t Storage::write(sg_size_t size) +{ + return simcall_storage_write(pimpl_, size); +} + /************* * Callbacks * *************/