X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f1e469ce075c0a1ad21a7fd0fdb587f9a3cb5289..274ff3a104711075a837ddc6e677e713b3348354:/include/simgrid/s4u/Storage.hpp diff --git a/include/simgrid/s4u/Storage.hpp b/include/simgrid/s4u/Storage.hpp index 305bbba87d..85c16ae3ce 100644 --- a/include/simgrid/s4u/Storage.hpp +++ b/include/simgrid/s4u/Storage.hpp @@ -17,17 +17,18 @@ namespace simgrid { namespace s4u { +std::unordered_map* allStorages(); + XBT_PUBLIC_CLASS Storage { friend s4u::Engine; - - Storage(std::string name, smx_storage_t inferior); + friend simgrid::surf::StorageImpl; public: - Storage() = default; - virtual ~Storage(); + explicit Storage(surf::StorageImpl * pimpl) : pimpl_(pimpl) {} + virtual ~Storage() = default; /** Retrieve a Storage by its name. It must exist in the platform file */ - static Storage& byName(const char* name); + static Storage* byName(const char* name); const char* name(); const char* host(); sg_size_t sizeFree(); @@ -38,22 +39,21 @@ public: const char* property(const char* key); void setProperty(const char* key, char* value); std::map* content(); - std::unordered_map* allStorages(); - -protected: - smx_storage_t inferior(); public: void setUserdata(void* data) { userdata_ = data; } void* userdata() { return userdata_; } -private: - static std::unordered_map* storages_; + /* The signals */ + /** @brief Callback signal fired when a new Link is created */ + static simgrid::xbt::signal onCreation; + + /** @brief Callback signal fired when a Link is destroyed */ + static simgrid::xbt::signal onDestruction; - std::string hostname_; +private: std::string name_; - sg_size_t size_ = 0; - smx_storage_t pimpl_ = nullptr; + surf::StorageImpl* const pimpl_ = nullptr; void* userdata_ = nullptr; };