MCPcopy Create free account
hub / github.com/RHVoice/RHVoice / execute

Method execute

src/sd_module/module.cpp:49–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 }
48
49 action_t module::execute()
50 {
51 logger::log(1,"Module has started");
52 action_t action=action_continue;
53 std::string line;
54 while(action==action_continue)
55 {
56 try
57 {
58 line=getline();
59 cmd_map::iterator it=subcommands.find(line);
60 if(it==subcommands.end())
61 {
62 logger::log(4,"Unknown command: ",line);
63 reply()("300 ERROR UNKNOWN COMMAND");
64 }
65 else
66 {
67 logger::log(4,"Received command ",line);
68 action=it->second->run();
69 }
70 }
71 catch(const std::exception& e)
72 {
73 logger::log(2,"aborting because of an unexpected error: ",e.what());
74 action=action_abort;
75 }
76 }
77 try
78 {
79 close();
80 }
81 catch(const std::exception& e)
82 {
83 logger::log(2,"Error while closing the module: ",e.what());
84 }
85 logger::log(1,"Exiting");
86 return action;
87 }
88
89 void module::close()
90 {

Callers

nothing calls this directly

Calls 6

getlineFunction · 0.85
replyClass · 0.85
findMethod · 0.45
endMethod · 0.45
runMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected