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 
17  job_ = nullptr;
18 }
19 
21  if (job_) {
22  auto manager = job_->manager();
23  manager->stopObservation(*this);
24  job_->stop();
25  }
26 }
27 
28 namespace knowrob::py {
29  template<>
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 }
void stopObservation()
Definition: Observer.cpp:20
std::shared_ptr< ObserverJob > job_
Definition: Observer.h:39
Observer(const std::shared_ptr< ObserverJob > &job)
Definition: Observer.cpp:12
void createType< Observer >()
Definition: Observer.cpp:30