openMSX
Public Types | Public Member Functions | List of all members
openmsx::MSXEventDistributor Class Reference

#include <MSXEventDistributor.hh>

Public Types

using EventPtr = std::shared_ptr< const Event >
 

Public Member Functions

 MSXEventDistributor (const MSXEventDistributor &)=delete
 
MSXEventDistributoroperator= (const MSXEventDistributor &)=delete
 
 MSXEventDistributor ()=default
 
 ~MSXEventDistributor ()
 
void registerEventListener (MSXEventListener &listener)
 Registers a given object to receive certain events. More...
 
void unregisterEventListener (MSXEventListener &listener)
 Unregisters a previously registered event listener. More...
 
void distributeEvent (const EventPtr &event, EmuTime::param time)
 Deliver the event to all registered listeners. More...
 

Detailed Description

Definition at line 13 of file MSXEventDistributor.hh.

Member Typedef Documentation

◆ EventPtr

using openmsx::MSXEventDistributor::EventPtr = std::shared_ptr<const Event>

Definition at line 16 of file MSXEventDistributor.hh.

Constructor & Destructor Documentation

◆ MSXEventDistributor() [1/2]

openmsx::MSXEventDistributor::MSXEventDistributor ( const MSXEventDistributor )
delete

◆ MSXEventDistributor() [2/2]

openmsx::MSXEventDistributor::MSXEventDistributor ( )
default

◆ ~MSXEventDistributor()

openmsx::MSXEventDistributor::~MSXEventDistributor ( )

Definition at line 8 of file MSXEventDistributor.cc.

Member Function Documentation

◆ distributeEvent()

void openmsx::MSXEventDistributor::distributeEvent ( const EventPtr event,
EmuTime::param  time 
)

Deliver the event to all registered listeners.

Parameters
eventThe event
timeCurrent time Note: MSXEventListener's are allowed to throw exceptions, and this method doesn't catch them (in case of an exception it's undefined which listeners receive the event)

Definition at line 29 of file MSXEventDistributor.cc.

References ranges::copy().

Referenced by openmsx::EventDelay::flush().

◆ operator=()

MSXEventDistributor& openmsx::MSXEventDistributor::operator= ( const MSXEventDistributor )
delete

◆ registerEventListener()

void openmsx::MSXEventDistributor::registerEventListener ( MSXEventListener listener)

Registers a given object to receive certain events.

Parameters
listenerListener that will be notified when an event arrives.

Definition at line 18 of file MSXEventDistributor.cc.

Referenced by openmsx::Keyboard::Keyboard(), openmsx::MSXCommandController::MSXCommandController(), and openmsx::VideoLayer::VideoLayer().

◆ unregisterEventListener()

void openmsx::MSXEventDistributor::unregisterEventListener ( MSXEventListener listener)

Unregisters a previously registered event listener.

Parameters
listenerListener to unregister.

Definition at line 24 of file MSXEventDistributor.cc.

References move_pop_back(), and rfind_unguarded().

Referenced by openmsx::JoyMega::unplugHelper(), openmsx::Joystick::unplugHelper(), openmsx::Keyboard::~Keyboard(), openmsx::MSXCommandController::~MSXCommandController(), and openmsx::VideoLayer::~VideoLayer().


The documentation for this class was generated from the following files: