ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
command_holder.cpp
1 #include "command_holder.h"
2 
3 void command_holder::call_function(const std::string &command,
4  const std::string &identity,
5  const std::vector<std::string> &message,
7 {
8  auto it = functions_.find(command);
9  if (it != functions_.end()) {
10  (it->second)(identity, message, respond);
11  }
12 }
13 
14 bool command_holder::register_command(const std::string &command, command_holder::callback_fn callback)
15 {
16  auto ret = functions_.emplace(command, callback);
17  return ret.second;
18 }
std::function< void(const message_container &)> response_cb
void call_function(const std::string &command, const std::string &identity, const std::vector< std::string > &message, handler_interface::response_cb respond)
bool register_command(const std::string &command, callback_fn callback)
std::function< void(const std::string &, const std::vector< std::string > &, handler_interface::response_cb)> callback_fn