knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
AnswerDontKnow.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 "knowrob/queries/AnswerDontKnow.h"
7 #include "knowrob/integration/python/utils.h"
8 
9 namespace knowrob {
10  const std::shared_ptr<const AnswerDontKnow> &GenericDontKnow() {
11  static const auto instance = std::make_shared<const AnswerDontKnow>();
12  return instance;
13  }
14 } // namespace knowrob
15 
16 using namespace knowrob;
17 
19  : Answer() {
20 }
21 
23  : Answer(other) {
24 }
25 
27  std::stringstream os;
28  if (reasonerTerm_) {
29  os << "[" << *reasonerTerm_ << "] ";
30  }
31  os << "don't know\n";
32  return os.str();
33 }
34 
36  static const std::string longMsg = "there was no evidence to conclude either yes or no";
37  return longMsg;
38 }
39 
40 namespace knowrob::py {
41  template<>
43  using namespace boost::python;
44  class_<AnswerDontKnow, std::shared_ptr<AnswerDontKnow>, bases<Answer>>
45  ("AnswerDontKnow", init<>());
46  // Allow implicit conversion of shared_ptr< AnswerDontKnow > to shared_ptr< const AnswerDontKnow >
47  register_ptr_to_python<std::shared_ptr<const AnswerDontKnow> >();
48  implicitly_convertible<std::shared_ptr<AnswerDontKnow>, std::shared_ptr<const AnswerDontKnow> >();
49  }
50 }
std::string humanReadableFormOfDontKnow() const
std::string stringFormOfDontKnow() const
AtomPtr reasonerTerm_
Definition: Answer.h:119
TermRule & string()
Definition: terms.cpp:63
void createType< AnswerDontKnow >()
const std::shared_ptr< const AnswerDontKnow > & GenericDontKnow()