X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf108868b4eeed4d0d9d343bc68557d7814e18c0..a844d6ba059b98ad6a5317e85a9c69402353b0a9:/include/simgrid/s4u/storage.hpp diff --git a/include/simgrid/s4u/storage.hpp b/include/simgrid/s4u/storage.hpp index 193a6d20fb..7e9add9612 100644 --- a/include/simgrid/s4u/storage.hpp +++ b/include/simgrid/s4u/storage.hpp @@ -7,24 +7,31 @@ #ifndef INCLUDE_SIMGRID_S4U_STORAGE_HPP_ #define INCLUDE_SIMGRID_S4U_STORAGE_HPP_ +#include + #include -#include "xbt/base.h" -#include "simgrid/simix.h" + +#include + +#include #include namespace simgrid { namespace s4u { XBT_PUBLIC_CLASS Storage { + friend s4u::Engine; + private: Storage(std::string name, smx_storage_t inferior); virtual ~Storage(); + public: /** Retrieve a Storage by its name. It must exist in the platform file */ static Storage &byName(const char* name); const char *name(); - sg_size_t size_free(); - sg_size_t size_used(); + sg_size_t sizeFree(); + sg_size_t sizeUsed(); /** Retrieve the total amount of space of this storage element */ sg_size_t size(); @@ -39,18 +46,17 @@ XBT_PUBLIC(const char *) MSG_storage_get_host(msg_storage_t storage); */ protected: smx_storage_t inferior(); -private: - static boost::unordered_map *storages; - std::string p_name; - smx_storage_t p_inferior; - public: - void set_userdata(void *data) {p_userdata = data;} - void *userdata() {return p_userdata;} + void setUserdata(void *data) {userdata_ = data;} + void *userdata() {return userdata_;} + private: - void *p_userdata = NULL; + static boost::unordered_map *storages_; + std::string name_; + smx_storage_t pimpl_ = nullptr; + void *userdata_ = nullptr; }; } /* namespace s4u */