knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
AnswerMerger.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #include <utility>
7 
8 #include "knowrob/queries/AnswerMerger.h"
9 
10 using namespace knowrob;
11 
14  partialResult_(std::move(partialResult)) {}
15 
17  if (tok->tokenType() == TokenType::ANSWER_TOKEN) {
18  auto answer = std::static_pointer_cast<const Answer>(tok);
19  return mergeAnswers(partialResult_, answer, true);
20  } else {
21  return tok;
22  }
23 }
AnswerMerger(AnswerPtr partialResult)
const AnswerPtr partialResult_
Definition: AnswerMerger.h:24
TokenPtr transform(const TokenPtr &tok) override
std::shared_ptr< const Token > TokenPtr
Definition: Token.h:74
AnswerPtr mergeAnswers(const AnswerPtr &a, const AnswerPtr &b, bool ignoreInconsistencies)
Definition: Answer.cpp:112
std::shared_ptr< const Answer > AnswerPtr
Definition: Answer.h:129