Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
37
libs/storage/downloader_queue_universal.hpp
Normal file
37
libs/storage/downloader_queue_universal.hpp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
#include "storage/downloader_queue_interface.hpp"
|
||||
#include "storage/queued_country.hpp"
|
||||
#include "storage/storage_defines.hpp"
|
||||
|
||||
#include <list>
|
||||
#include <utility>
|
||||
|
||||
namespace storage
|
||||
{
|
||||
class Queue : public QueueInterface
|
||||
{
|
||||
public:
|
||||
using ForEachCountryMutable = std::function<void(QueuedCountry & country)>;
|
||||
|
||||
// QueueInterface overrides:
|
||||
bool IsEmpty() const override;
|
||||
size_t Count() const override;
|
||||
bool Contains(CountryId const & country) const override;
|
||||
void ForEachCountry(ForEachCountryFunction const & fn) const override;
|
||||
|
||||
void ForEachCountry(ForEachCountryMutable const & fn);
|
||||
|
||||
CountryId const & GetFirstId() const;
|
||||
QueuedCountry const & GetFirstCountry() const;
|
||||
void PopFront();
|
||||
|
||||
void Append(QueuedCountry && country);
|
||||
|
||||
void Remove(CountryId const & country);
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
std::list<QueuedCountry> m_queue;
|
||||
};
|
||||
} // namespace storage
|
||||
Loading…
Add table
Add a link
Reference in a new issue