X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/121e1dc6ee0462b6f6f1f1570b0f48c61ee4ff9a..183a6118a95c570b0c66695505dab7dbebc0c7b3:/include/simgrid/s4u/Storage.hpp?ds=sidebyside diff --git a/include/simgrid/s4u/Storage.hpp b/include/simgrid/s4u/Storage.hpp index 305bbba87d..f366c3a982 100644 --- a/include/simgrid/s4u/Storage.hpp +++ b/include/simgrid/s4u/Storage.hpp @@ -17,44 +17,47 @@ namespace simgrid { namespace s4u { +XBT_ATTRIB_PUBLIC std::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(); + const char* type(); + Host* host(); sg_size_t sizeFree(); sg_size_t sizeUsed(); /** Retrieve the total amount of space of this storage element */ sg_size_t size(); + xbt_dict_t properties(); const char* property(const char* key); void setProperty(const char* key, char* value); - std::map* content(); - std::unordered_map* allStorages(); + std::map* content(); -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_; + Host* attached_to_ = nullptr; + surf::StorageImpl* const pimpl_ = nullptr; + +private: std::string name_; - sg_size_t size_ = 0; - smx_storage_t pimpl_ = nullptr; - void* userdata_ = nullptr; + void* userdata_ = nullptr; }; } /* namespace s4u */