* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/s4u/storage.hpp"
+#include "simgrid/simix.hpp"
+#include "src/surf/storage_interface.hpp"
#include "xbt/lib.h"
extern xbt_lib_t storage_lib;
Storage::Storage(std::string name, smx_storage_t inferior) :
name_(name), pimpl_(inferior)
{
+ size_ = SIMIX_storage_get_size(pimpl_);
storages_->insert({name, this});
}
return *res;
}
-const char*Storage::name() {
+const char* Storage::name()
+{
return name_.c_str();
}
-sg_size_t Storage::sizeFree() {
+sg_size_t Storage::sizeFree()
+{
return simcall_storage_get_free_size(pimpl_);
}
-sg_size_t Storage::sizeUsed() {
+
+sg_size_t Storage::sizeUsed()
+{
return simcall_storage_get_used_size(pimpl_);
}
+
sg_size_t Storage::size() {
- return SIMIX_storage_get_size(pimpl_);
+ return size_;
+}
+
+xbt_dict_t Storage::properties()
+{
+ return simcall_storage_get_properties(pimpl_);
+}
+
+std::map<std::string, sg_size_t*>* Storage::content()
+{
+ return simgrid::simix::kernelImmediate(
+ [this] { return static_cast<simgrid::surf::Storage*>(surf_storage_resource_priv(this->pimpl_))->getContent(); });
}
} /* namespace s4u */