Garmin Fleet Management Controller
2.19.0
|
#include <Event.h>
Static Public Member Functions | |
static void | addListener (EventListener *aListener) |
Adds a window that is interested in receiving events. More... | |
static void | post (EventId aEventId, uint32 aEventData=0, void *aEventDataPtr=NULL, BOOL handleNow=FALSE) |
Posts a message to all windows that have registered to get events. More... | |
static void | removeListener (EventListener *aListener) |
Remove a target window from the interested object list. More... | |
Static Private Attributes | |
static std::list< EventListener * > | mListeners |
List of listeners that should receive event notifications. More... | |
Event dispatcher.
The Event class manages event posting between objects. To post an event, call Event::post(). The event will then be dispatched to all EventListener objects that have registered themselves via the addListener interface.
An event dispatcher is not always strictly required (direct callbacks can usually be used instead) but use of an event system improves maintainability, as it decouples event senders from receivers, and allows code to be written more expressively, in terms of real-world things that have happened.
|
static |
Adds a window that is interested in receiving events.
aTarget | The object that is interested in events |
Definition at line 24 of file Event.cpp.
References removeListener().
Referenced by EventListener::EventListener().
|
static |
Posts a message to all windows that have registered to get events.
Calls the onEvent function for all registered listeners.
aEventId | The event ID that is posted. |
aEventData | A small bit of event data, may be 0 |
aEventDataPtr | A pointer to a longer bit of event data, may be NULL if not used |
handleNow | A boolean to determine if the event is queued or processed immediately |
Definition at line 67 of file Event.cpp.
Referenced by Logger::clearLog(), FmiApplicationLayer::endFileReceive(), Logger::logRawData(), FmiApplicationLayer::onAck(), CFmiPcAppDlg::OnInitDialog(), GarminTransportLayer::onTimer(), CCannedTxtMsgDlg::PostNcDestroy(), CStopListDlg::PostNcDestroy(), CDriverIdAndStatusDlg::PostNcDestroy(), CManageCannedResponseDlg::PostNcDestroy(), CCommErrorDlg::PostNcDestroy(), CWaypointDlg::PostNcDestroy(), CLogViewerDlg::PostNcDestroy(), FmiApplicationLayer::procDriverStatusUpdate(), removeListener(), FmiApplicationLayer::resetCannedMessages(), FmiApplicationLayer::resetCannedResponses(), FmiApplicationLayer::resetDriverStatusList(), FmiApplicationLayer::resetWaypoints(), FmiApplicationLayer::rx(), FmiApplicationLayer::sendDeleteWaypoint(), FmiApplicationLayer::sendDeleteWaypointCat(), FmiApplicationLayer::sendFile(), and FmiApplicationLayer::stopFileTransfer().
|
static |
Remove a target window from the interested object list.
aTarget | The object that is no longer interested |
Definition at line 40 of file Event.cpp.
References post().
Referenced by addListener(), and EventListener::~EventListener().
|
staticprivate |