#ifndef STORAGE_PROVIDER_H #define STORAGE_PROVIDER_H #include #include #include #include "data/IntermediateStorage.h" class StorageProvider { public: int getStorageCount() const; void insert(std::shared_ptr storage); // returns empty shared_ptr if no storages available std::shared_ptr consumeSecondLargestStorage(); // returns empty shared_ptr if no storages available std::shared_ptr consumeLargestStorage(); void logCurrentState() const; private: std::list> m_storages; // larger storages are in front mutable std::mutex m_storagesMutex; }; #endif // STORAGE_PROVIDER_H