knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
Observer.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/storage/Observer.h"
7
#include "knowrob/storage/ObserverJob.h"
8
#include "knowrob/integration/python/utils.h"
9
10
using namespace
knowrob
;
11
12
Observer::Observer
(
const
std::shared_ptr<ObserverJob> &job)
13
: job_(job) {}
14
15
Observer::~Observer
() {
16
stopObservation
();
17
job_
=
nullptr
;
18
}
19
20
void
Observer::stopObservation
() {
21
if
(
job_
) {
22
auto
manager =
job_
->manager();
23
manager->stopObservation(*
this
);
24
job_
->stop();
25
}
26
}
27
28
namespace
knowrob::py
{
29
template
<>
30
void
createType<Observer>
() {
31
using namespace
boost::python
;
32
33
class_<Observer, std::shared_ptr<Observer>, boost::noncopyable>
34
(
"Observer"
, no_init)
35
.def(
"stopObservation"
, &
Observer::stopObservation
);
36
}
37
}
knowrob::Observer::stopObservation
void stopObservation()
Definition:
Observer.cpp:20
knowrob::Observer::job_
std::shared_ptr< ObserverJob > job_
Definition:
Observer.h:39
knowrob::Observer::Observer
Observer(const std::shared_ptr< ObserverJob > &job)
Definition:
Observer.cpp:12
knowrob::Observer::~Observer
~Observer()
Definition:
Observer.cpp:15
boost::python
Definition:
shared_ptr.cpp:13
knowrob::py
Definition:
dict.h:10
knowrob::py::createType< Observer >
void createType< Observer >()
Definition:
Observer.cpp:30
knowrob
Definition:
DataSource.h:13
src
storage
Observer.cpp
Generated by
1.9.1