knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
QueryContext.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/QueryContext.h"
7
#include "knowrob/integration/python/utils.h"
8
#include "knowrob/queries/QueryFlag.h"
9
10
using namespace
knowrob
;
11
12
namespace
knowrob::py
{
13
template
<>
14
void
createType<QueryContext>
() {
15
using namespace
boost::python
;
16
17
enum_<QueryFlag>(
"QueryFlag"
)
18
.value(
"QUERY_FLAG_ALL_SOLUTIONS"
,
QUERY_FLAG_ALL_SOLUTIONS
)
19
.value(
"QUERY_FLAG_ONE_SOLUTION"
,
QUERY_FLAG_ONE_SOLUTION
)
20
.value(
"QUERY_FLAG_PERSIST_SOLUTIONS"
,
QUERY_FLAG_PERSIST_SOLUTIONS
)
21
.value(
"QUERY_FLAG_UNIQUE_SOLUTIONS"
,
QUERY_FLAG_UNIQUE_SOLUTIONS
)
22
.export_values();
23
24
class_<QueryContext, std::shared_ptr<QueryContext>>
25
(
"QueryContext"
, init<int>())
26
.def(init<const QueryContext &, const ModalOperatorPtr &>())
27
.def_readwrite(
"queryFlags"
, &
QueryContext::queryFlags
)
28
.def_readwrite(
"modalIteration"
, &
QueryContext::modalIteration
)
29
.def_readwrite(
"selector"
, &
QueryContext::selector
);
30
31
// QueryContextPtr uses `const QueryContext` which currently requires
32
// a custom converter to be defined in order to be used in Python.
33
register_ptr_to_python<std::shared_ptr<const QueryContext> >();
34
implicitly_convertible<std::shared_ptr<QueryContext>, std::shared_ptr<const QueryContext> >();
35
}
36
}
boost::python
Definition:
shared_ptr.cpp:13
knowrob::py
Definition:
dict.h:10
knowrob::py::createType< QueryContext >
void createType< QueryContext >()
Definition:
QueryContext.cpp:14
knowrob
Definition:
DataSource.h:13
knowrob::QUERY_FLAG_ONE_SOLUTION
@ QUERY_FLAG_ONE_SOLUTION
Definition:
QueryFlag.h:17
knowrob::QUERY_FLAG_ALL_SOLUTIONS
@ QUERY_FLAG_ALL_SOLUTIONS
Definition:
QueryFlag.h:15
knowrob::QUERY_FLAG_UNIQUE_SOLUTIONS
@ QUERY_FLAG_UNIQUE_SOLUTIONS
Definition:
QueryFlag.h:21
knowrob::QUERY_FLAG_PERSIST_SOLUTIONS
@ QUERY_FLAG_PERSIST_SOLUTIONS
Definition:
QueryFlag.h:19
knowrob::QueryContext::selector
GraphSelector selector
Definition:
QueryContext.h:38
knowrob::QueryContext::queryFlags
int queryFlags
Definition:
QueryContext.h:30
knowrob::QueryContext::modalIteration
ModalIteration modalIteration
Definition:
QueryContext.h:34
src
queries
QueryContext.cpp
Generated by
1.9.1