Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

EventTrapper.h

Go to the documentation of this file.
00001 #ifndef INCLUDED_EventTrapper_h
00002 #define INCLUDED_EventTrapper_h
00003 
00004 #include "EventBase.h"
00005 
00006 //! An interface to allow a standard method of trapping events
00007 /*! Trappers get first dibs on events and can prevent the event from being sent any further\n
00008  *  This is handy in situations where an event is more than a notification, and must be "handled" - 
00009  *  the trapper which handles it returns true, otherwise it is passed to the next one\n
00010  *  A trapper can filter any and all events, EXCEPT timers.  This *could* be changed, if a good
00011  *  reason is presented. */
00012 class EventTrapper {
00013  public:
00014   //! destructor
00015   virtual ~EventTrapper() {}
00016 
00017   //! for receiving events - you must override this to inherit
00018   /*! @see EventRouter
00019    *  @param event the event being received
00020    *  @return @c true if the event was trapped (shouldn't be sent to listeners), @c false otherwise*/
00021   virtual bool trapEvent(const EventBase& event)=0;
00022 };
00023 
00024 /*! @file
00025  * @brief Defines EventTrapper class, an interface for anything that wants to trap events
00026  * @author ejt (Creator)
00027  */
00028 
00029 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:38 2016 by Doxygen 1.6.3