Class mrptEvent

Inheritance Relationships

Derived Type

Class Documentation

class mrptEvent

The basic event type for the observer-observable pattern in MRPT. You can sub-class this base class to create custom event types, then tell between them in runtime with isOfType<T>(), for example:

if (e.isOfType<mrptEventOnDestroy>())
{
  const mrptEventOnDestroy* ev = e.getAs<mrptEventOnDestroy>();
  ev-> ...
}

Subclassed by mrpt::system::mrptEventOnDestroy

Public Functions

mrptEvent() = default
virtual ~mrptEvent() = default
template<class EVENTTYPE>
inline bool isOfType() const
template<class EVENTTYPE>
inline const EVENTTYPE *getAs() const
template<class EVENTTYPE>
inline EVENTTYPE *getAsNonConst() const

Public Members

mrpt::Clock::time_point timestamp = {mrpt::Clock::now()}

Protected Functions

inline virtual void do_nothing()

Just to allow this class to be polymorphic