std::vector<std::string> MultiSessionChatbot<SessionIdType>::treatMessage( const SessionIdType& sessionId, const std::string& message) { typename SessionIndex::iterator it = m_sessionIndex.find(sessionId); std::vector<std::string> replies; if (it != m_sessionIndex.end()) { UserDefinedActionHandlerAdapter actionHandler(*this, replies, it->first, m_userDefinedActionHandler); Chatbot::VariablesMap userDefinedVariables; Chatbot::VariablesMap intentVariables; std::string currentStateId = it->second.currentStateId; Chatbot::treatMessage(message, it->second, actionHandler, intentVariables, userDefinedVariables); } return replies; }
void ActionLoader::addTool(ITool *tool,QToolBar *tb) { tb->addAction(tool); tool->connect(tool,SIGNAL(triggered()),tool,SLOT(actionHandler())); }
// Just redirects to actionHandler(ActionEvent) void ArduinOS::actionHandler(ActionType type){ static ActionEvent evt; evt.type = type; actionHandler(evt); }