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 "noncopyable.hh"
6 #include <memory>
7 #include <vector>
8 
9 namespace openmsx {
10 
11 class MSXEventListener;
12 class Event;
13 
15 {
16 public:
17  typedef std::shared_ptr<const Event> EventPtr;
18 
21 
27 
33 
41  void distributeEvent(const EventPtr& event, EmuTime::param time);
42 
43 private:
44  bool isRegistered(MSXEventListener* listener) const;
45 
46  std::vector<MSXEventListener*> listeners;
47 };
48 
49 } // namespace openmsx
50 
51 #endif
std::shared_ptr< const Event > EventPtr
void registerEventListener(MSXEventListener &listener)
Registers a given object to receive certain events.
void distributeEvent(const EventPtr &event, EmuTime::param time)
Deliver the event to all registered listeners.
void unregisterEventListener(MSXEventListener &listener)
Unregisters a previously registered event listener.
Based on boost::noncopyable, see boost documentation: http://www.boost.org/libs/utility.
Definition: noncopyable.hh:12