knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
Query.h
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 #ifndef KNOWROB_QUERY_H_
7 #define KNOWROB_QUERY_H_
8 
9 #include <ostream>
10 #include <knowrob/formulas/Formula.h>
11 #include "QueryContext.h"
12 
13 namespace knowrob {
19 
24 
29  class Query : public Printable {
30  public:
34  explicit Query(QueryContextPtr ctx = DefaultQueryContext()) : ctx_(std::move(ctx)) {}
35 
36  virtual ~Query() = default;
37 
41  auto &ctx() const { return ctx_; }
42 
46  void setContext(QueryContextPtr ctx) { ctx_ = std::move(ctx); }
47 
48  protected:
50  };
51 }
52 
53 #endif //KNOWROB_QUERY_H_
void setContext(QueryContextPtr ctx)
Definition: Query.h:46
virtual ~Query()=default
auto & ctx() const
Definition: Query.h:41
Query(QueryContextPtr ctx=DefaultQueryContext())
Definition: Query.h:34
QueryContextPtr ctx_
Definition: Query.h:49
QueryContextPtr DefaultQueryContext()
Definition: Query.cpp:11
QueryContextPtr OneSolutionContext()
Definition: Query.cpp:15
std::shared_ptr< const QueryContext > QueryContextPtr
Definition: QueryContext.h:41