#ifndef COMMANDEXECUTOR_H #define COMMANDEXECUTOR_H #include #include #include #include #include "ExecutableCommand.h" class CommandExecutor { public: CommandExecutor(): stop(false) { } void Shutdown(); void AddTask(std::shared_ptr command); void RemoveFinishedTasks(); private: struct Task { std::shared_ptr command; std::future future; }; std::vector tasks; mutable std::mutex queueMutex; std::atomic stop; }; #endif //COMMANDEXECUTOR_H