Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Public Attributes | Protected Member Functions
mrpt::utils::mrptEvent Class Reference

Detailed Description

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-> ...
}
See also
CObserver, CObservable

Definition at line 34 of file mrptEvent.h.

#include <mrpt/utils/mrptEvent.h>

Inheritance diagram for mrpt::utils::mrptEvent:
Inheritance graph

Public Member Functions

 mrptEvent ()
 Default ctor. More...
 
template<class EVENTTYPE >
bool isOfType () const
 
template<class EVENTTYPE >
const EVENTTYPE * getAs () const
 
template<class EVENTTYPE >
EVENTTYPE * getAsNonConst () const
 

Public Attributes

mrpt::system::TTimeStamp timestamp
 

Protected Member Functions

virtual void do_nothing ()
 Just to allow this class to be polymorphic. More...
 

Constructor & Destructor Documentation

◆ mrptEvent()

mrpt::utils::mrptEvent::mrptEvent ( )
inline

Default ctor.

Definition at line 41 of file mrptEvent.h.

Member Function Documentation

◆ do_nothing()

virtual void mrpt::utils::mrptEvent::do_nothing ( )
inlineprotectedvirtual

◆ getAs()

template<class EVENTTYPE >
const EVENTTYPE* mrpt::utils::mrptEvent::getAs ( ) const
inline

Definition at line 49 of file mrptEvent.h.

◆ getAsNonConst()

template<class EVENTTYPE >
EVENTTYPE* mrpt::utils::mrptEvent::getAsNonConst ( ) const
inline

Definition at line 55 of file mrptEvent.h.

◆ isOfType()

template<class EVENTTYPE >
bool mrpt::utils::mrptEvent::isOfType ( ) const
inline

Definition at line 43 of file mrptEvent.h.

Referenced by mrpt::graphslam::CWindowObserver::OnEvent(), and mrpt::slam::COccupancyGridMapFeatureExtractor::OnEvent().

Here is the caller graph for this function:

Member Data Documentation

◆ timestamp

mrpt::system::TTimeStamp mrpt::utils::mrptEvent::timestamp

Definition at line 60 of file mrptEvent.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019