Main MRPT website > C++ reference
MRPT logo
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 53 of file mrptEvent.h.

#include <mrpt/utils/mrptEvent.h>

Inheritance diagram for mrpt::utils::mrptEvent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

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

Public Attributes

mrpt::system::TTimeStamp timestamp

Protected Member Functions

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

Constructor & Destructor Documentation

mrpt::utils::mrptEvent::mrptEvent ( ) [inline]

Default ctor.

Definition at line 59 of file mrptEvent.h.


Member Function Documentation

virtual void mrpt::utils::mrptEvent::do_nothing ( ) [inline, protected, virtual]
template<class EVENTTYPE >
const EVENTTYPE* mrpt::utils::mrptEvent::getAs ( ) const [inline]

Definition at line 65 of file mrptEvent.h.

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

Definition at line 62 of file mrptEvent.h.


Member Data Documentation

Definition at line 67 of file mrptEvent.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011