openMSX
MSXEventDistributor.hh
Go to the documentation of this file.
1#ifndef MSXEVENTDISTRIBUTOR_HH
2#define MSXEVENTDISTRIBUTOR_HH
3
4#include "EmuTime.hh"
5#include "Event.hh"
6#include <vector>
7
8namespace openmsx {
9
10class MSXEventListener;
11
13{
14public:
17
20
26
32
40 void distributeEvent(const Event& event, EmuTime::param time);
41
42private:
43 [[nodiscard]] bool isRegistered(MSXEventListener* listener) const;
44
45private:
46 std::vector<MSXEventListener*> listeners; // unordered
47 std::vector<MSXEventListener*> listenersCopy; // see distributeEvent()
48};
49
50} // namespace openmsx
51
52#endif
MSXEventDistributor & operator=(const MSXEventDistributor &)=delete
void registerEventListener(MSXEventListener &listener)
Registers a given object to receive certain events.
void distributeEvent(const Event &event, EmuTime::param time)
Deliver the event to all registered listeners.
MSXEventDistributor(const MSXEventDistributor &)=delete
void unregisterEventListener(MSXEventListener &listener)
Unregisters a previously registered event listener.
This file implemented 3 utility functions:
Definition Autofire.cc:9
std::variant< KeyUpEvent, KeyDownEvent, MouseMotionEvent, MouseButtonUpEvent, MouseButtonDownEvent, MouseWheelEvent, JoystickAxisMotionEvent, JoystickHatEvent, JoystickButtonUpEvent, JoystickButtonDownEvent, OsdControlReleaseEvent, OsdControlPressEvent, WindowEvent, TextEvent, FileDropEvent, QuitEvent, FinishFrameEvent, CliCommandEvent, GroupEvent, BootEvent, FrameDrawnEvent, BreakEvent, SwitchRendererEvent, TakeReverseSnapshotEvent, AfterTimedEvent, MachineLoadedEvent, MachineActivatedEvent, MachineDeactivatedEvent, MidiInReaderEvent, MidiInWindowsEvent, MidiInCoreMidiEvent, MidiInCoreMidiVirtualEvent, MidiInALSAEvent, Rs232TesterEvent, Rs232NetEvent, ImGuiDelayedActionEvent, ImGuiActiveEvent > Event
Definition Event.hh:454