Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
CommandManager.hpp
Go to the documentation of this file.
1 
11 #ifndef RECAST_SERVER_COMMANDMANAGER_H
12 #define RECAST_SERVER_COMMANDMANAGER_H
13 
14 #include <vector>
15 #include <string>
16 #include <boost/shared_ptr.hpp>
17 #include <boost/lockfree/queue.hpp>
18 #include <queue>
19 #include "utils/DelayCommand.h"
20 
21 class ICommandSender;
22 
23 class ICommand;
24 
31 public:
33 
34  CommandManager(const CommandManager &other) = delete;
35 
36  void onCommand(ICommandSender *sender, const std::string &cmd);
37 
39 
40 private:
41  std::vector<std::shared_ptr<ICommand>> commands;
42  boost::lockfree::queue<DelayCommand *, boost::lockfree::capacity<10>> delayedCommand;
43 };
44 
45 
46 #endif //RECAST_SERVER_COMMANDMANAGER_H
void executeDelayedCommandInUI()
Definition: CommandManager.cpp:90
CommandManager()
Init CommandManager.
Definition: CommandManager.cpp:47
Send string-command through CommandManager.
Definition: CommandManager.hpp:30
void onCommand(ICommandSender *sender, const std::string &cmd)
Definition: CommandManager.cpp:61
Definition: ICommandSender.hpp:12
Superclass for Command object.
Definition: ICommand.hpp:26