1 /* Copyright (c) 2006-2015, 2017. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef INCLUDE_SIMGRID_S4U_STORAGE_HPP_
8 #define INCLUDE_SIMGRID_S4U_STORAGE_HPP_
11 #include <simgrid/s4u/forward.hpp>
12 #include <simgrid/simix.h>
14 #include <unordered_map>
20 XBT_PUBLIC_CLASS Storage
24 Storage(std::string name, smx_storage_t inferior);
29 /** Retrieve a Storage by its name. It must exist in the platform file */
30 static Storage& byName(const char* name);
35 /** Retrieve the total amount of space of this storage element */
37 xbt_dict_t properties();
38 const char* property(const char* key);
39 void setProperty(const char* key, char* value);
40 std::map<std::string, sg_size_t*>* content();
41 std::unordered_map<std::string, Storage*>* allStorages();
44 smx_storage_t inferior();
47 void setUserdata(void* data) { userdata_ = data; }
48 void* userdata() { return userdata_; }
51 static std::unordered_map<std::string, Storage*>* storages_;
53 std::string hostname_;
56 smx_storage_t pimpl_ = nullptr;
57 void* userdata_ = nullptr;
61 } /* namespace simgrid */
63 #endif /* INCLUDE_SIMGRID_S4U_STORAGE_HPP_ */