Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SimpleGUI by
EventDispatcher.h
00001 #ifndef SIMPLEGUI_EVENT_DISPATCHER_H 00002 #define SIMPLEGUI_EVENT_DISPATCHER_H 00003 00004 #include "rtos.h" 00005 00006 #include "EventListener.h" 00007 #include "LinkedList.h" 00008 00009 class EventDispatcher 00010 { 00011 00012 00013 public: 00014 00015 EventDispatcher(); 00016 00017 void attachListener(EventListener* l); 00018 void detachListener(EventListener* l); 00019 void dispatchEvent(Event e); 00020 00021 /** 00022 * Normally called from a separate thread to queue an event for later processing by the main thread 00023 **/ 00024 void queueEvent(const Event e); 00025 00026 /** 00027 * Should be called on the main thread 00028 **/ 00029 void pumpEvents(); 00030 00031 private: 00032 00033 LinkedList<EventListener> _listeners; 00034 Mail<Event, 64> _mailbox; 00035 00036 }; 00037 00038 #endif
Generated on Tue Jul 12 2022 22:27:14 by
