MRPT
2.0.1
|
Inherit from this class to get notified about events from any CObservable object after subscribing to it.
The main methods in this class are:
Note that if custom (child) mrptEvent classes are used, you can tell between them in runtime with "dynamic_cast<>()".
Definition at line 34 of file CObserver.h.
#include <mrpt/system/CObserver.h>
Public Member Functions | |
CObserver () | |
virtual | ~CObserver () |
void | observeBegin (CObservable &obj) |
Starts the subscription of this observer to the given object. More... | |
void | observeEnd (CObservable &obj) |
Ends the subscription of this observer to the given object (note that there is no need to call this method, since the destruction of the first of observer/observed will put an end to the process. More... | |
Protected Member Functions | |
virtual void | OnEvent (const mrptEvent &e)=0 |
This virtual function will be called upon receive of any event after starting listening at any CObservable object. More... | |
Private Member Functions | |
void | internal_on_event (const mrptEvent &e) |
Private Attributes | |
std::set< CObservable * > | m_subscribed |
Friends | |
class | CObservable |
|
default |
|
virtual |
Definition at line 19 of file CObserver.cpp.
|
private |
Definition at line 47 of file CObserver.cpp.
void CObserver::observeBegin | ( | CObservable & | obj | ) |
Starts the subscription of this observer to the given object.
Definition at line 26 of file CObserver.cpp.
References mrpt::system::CObservable::internal_observer_begin().
Referenced by CGraphSlamHandler< GRAPH_T >::initVisualization().
void CObserver::observeEnd | ( | CObservable & | obj | ) |
Ends the subscription of this observer to the given object (note that there is no need to call this method, since the destruction of the first of observer/observed will put an end to the process.
Definition at line 36 of file CObserver.cpp.
|
protectedpure virtual |
This virtual function will be called upon receive of any event after starting listening at any CObservable object.
Implemented in mrpt::slam::COccupancyGridMapFeatureExtractor, mrpt::graphslam::CWindowObserver, TMyExtraRenderingStuff, MyObserver, and MyObserver.
|
friend |
Definition at line 36 of file CObserver.h.
|
private |
Definition at line 53 of file CObserver.h.
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |