Wyatt  1.0.1
CommandManager.h
1 //
2 // Created by Arthur Lockman on 4/5/17.
3 //
4 
5 #pragma once
6 
7 #include "Command.h"
8 #include "Thread.h"
9 #include <list>
10 #include <iostream>
11 #include <map>
12 #include <mutex>
13 
17 class CommandManager: public Thread {
18 public:
34  bool runCommand(Command *command);
41  bool cancel(Command* command);
46  bool cancelAll();
51  void* run();
56  int join();
61  int kill();
66  unsigned long inFlight();
67 private:
69  std::list<Command*> m_commands;
71  std::map<Command*, int> m_command_flags;
73  std::mutex mtx;
74 };
bool cancel(Command *command)
Definition: Thread.h:32
Definition: Command.h:6
bool runCommand(Command *command)
unsigned long inFlight()