| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "icommandqueue.h" |
| 7 | #include <string> |
| 8 | #include <unordered_set> |
| 9 | #include <vector> |
| 10 | |
| 11 | class CommandQueue : public ICommandQueue |
| 12 | { |
| 13 | public: |
| 14 | CommandQueue(std::unordered_set<std::string> &&multiCommandFiles = {}) noexcept; |
| 15 | |
| 16 | bool hasCommandQueuedFor(std::string const &file) override; |
| 17 | void add(std::pair<std::string, std::string> &&cmd) override; |
| 18 | QByteArray toRawData() override; |
| 19 | void logCommands() const override; |
| 20 | |
| 21 | protected: |
| 22 | std::vector<std::pair<std::string, std::string>> &commands(); |
| 23 | |
| 24 | private: |
| 25 | std::unordered_set<std::string> multiCommandFiles_; |
| 26 | std::vector<std::pair<std::string, std::string>> commands_; |
| 27 | }; |