42 template <
class EVENTTYPE>
43 inline bool isOfType()
const {
return dynamic_cast<const EVENTTYPE*
>(
this)!=NULL; }
45 template <
class EVENTTYPE>
46 inline const EVENTTYPE*
getAs()
const {
return dynamic_cast<const EVENTTYPE*
>(
this); }
48 template <
class EVENTTYPE>
49 inline EVENTTYPE*
getAsNonConst()
const {
return const_cast<EVENTTYPE*
>(
dynamic_cast<const EVENTTYPE*
>(
this)); }
Inherit from this class for those objects capable of being observed by a CObserver class.
The basic event type for the observer-observable pattern in MRPT.
const EVENTTYPE * getAs() const
EVENTTYPE * getAsNonConst() const
mrpt::system::TTimeStamp timestamp
virtual void do_nothing()
Just to allow this class to be polymorphic.
An event sent by any CObservable object (automatically) just before being destroyed and telling its o...
mrptEventOnDestroy(const CObservable *obj)
void do_nothing() MRPT_OVERRIDE
Just to allow this class to be polymorphic.
const CObservable * source_object
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.