Elimination of Service object,
This commit is contained in:
1 parent
a46db126e9
commit
a40f7314a8
440 files changed
+17787
-516
No files matched your search
+3
-7
@@ -1,11 +1,7 @@
|
||||
#include "CommandList.h"\
|
||||
|
||||
namespace core {
|
||||
|
||||
CommandList::CommandList() {}
|
||||
|
||||
CommandList::~CommandList() {}
|
||||
|
||||
|
||||
void CommandList::add(Command &command, std::string name) {
|
||||
command.setName(name);
|
||||
commands.push_back(&command);
|
||||
@@ -15,7 +11,7 @@ namespace core {
|
||||
|
||||
}
|
||||
|
||||
bool CommandList::processRequest(std::string request, Session *session, std::stringstream &data) {
|
||||
bool CommandList::processRequest(std::string request, TCPSession *session, std::stringstream &data) {
|
||||
for(auto *command : commands) {
|
||||
if(command->check(request)) {
|
||||
command->processCommand(request, session, data);
|
||||
@@ -25,7 +21,7 @@ namespace core {
|
||||
return false;
|
||||
}
|
||||
|
||||
int CommandList::processCommand(std::string request, Session *session, std::stringstream &data) {
|
||||
int CommandList::processCommand(std::string request, TCPSession *session, std::stringstream &data) {
|
||||
for(Command *command : commands)
|
||||
data << command->getName() << std::endl;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user