sources as different names, explicit targets

This commit is contained in:
Blue 2023-10-02 14:19:24 -03:00
parent cc4d8d1fc3
commit 1d9a6ec3f8
Signed by: blue
GPG key ID: 9B203B252A63EE38
10 changed files with 252 additions and 62 deletions

View file

@ -14,12 +14,13 @@
#include "component.h"
#include "download.h"
#include "taskmanager.h"
#include "source.h"
class Collection : protected Loggable {
using Sources = std::set<std::string>;
using SourcesQueue = std::queue<std::string>;
using Downloads = std::map<std::string, std::unique_ptr<Download>>;
using Components = std::map<std::string, std::unique_ptr<Component>>;
using Sources = std::set<Source>;
using SourcesQueue = std::queue<Source>;
using Downloads = std::map<Source, std::unique_ptr<Download>>;
using Components = std::map<Source, std::unique_ptr<Component>>;
public:
Collection(
@ -37,22 +38,22 @@ public:
unsigned int sourcesError() const;
unsigned int sourcesSuccess() const;
bool hasSource(const std::string& source) const;
void addSource(const std::string& source);
bool hasSource(const Source& source) const;
void addSource(const Source& source);
private:
void sourceDownaloded(const std::string& source, TaskManager::Error err);
void sourceRead(const std::string& source, TaskManager::Error err);
void sourceBuilt(const std::string& source, TaskManager::Error err);
void sourceDownaloded(const Source& source, TaskManager::Error err);
void sourceRead(const Source& source, TaskManager::Error err);
void sourceBuilt(const Source& source, TaskManager::Error err);
void rootBuilt(TaskManager::Error err);
static bool isRemote(const std::string& source);
void processSource(const std::string& source);
void queueDownload(const std::string& source);
void queueRead(const std::string& source, const std::filesystem::path& location);
void processSource(const Source& source);
void queueDownload(const Source& source);
void queueRead(const Source& source, const std::filesystem::path& location);
bool _hasSource(const std::string& source) const;
bool _hasSource(const Source& source) const;
unsigned int _sourcesTotal() const;
unsigned int _sourcesPending() const;
unsigned int _sourcesError() const;