Go to the documentation of this file.
29 while (!m_subscribers.empty())
30 (*m_subscribers.begin())->observeEnd(*
this);
32 catch (
const std::exception& e)
40 m_subscribers.insert(o);
46 auto it = m_subscribers.find(o);
48 it != m_subscribers.end(),
49 "Ending subscription from an observer not subscribed to this object!");
50 m_subscribers.erase(it);
60 for (
auto& s : m_subscribers)
61 if (s) s->internal_on_event(e);
The basic event type for the observer-observable pattern in MRPT.
void publishEvent(const mrptEvent &e) const
Called when you want this object to emit an event to all the observers currently subscribed to this o...
void internal_observer_begin(CObserver *)
An event sent by any CObservable object (automatically) just before being destroyed and telling its o...
void internal_observer_end(CObserver *)
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
Inherit from this class to get notified about events from any CObservable object after subscribing to...
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Fri Jul 17 08:43:33 UTC 2020 | |