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

#include <MSXEventDistributor.hh>

Public Member Functions

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

Detailed Description

Definition at line 12 of file MSXEventDistributor.hh.

Constructor & Destructor Documentation

◆ MSXEventDistributor() [1/3]

openmsx::MSXEventDistributor::MSXEventDistributor ( )
default

◆ MSXEventDistributor() [2/3]

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

◆ MSXEventDistributor() [3/3]

openmsx::MSXEventDistributor::MSXEventDistributor ( MSXEventDistributor &&  )
delete

◆ ~MSXEventDistributor()

openmsx::MSXEventDistributor::~MSXEventDistributor ( )

Definition at line 8 of file MSXEventDistributor.cc.

Member Function Documentation

◆ distributeEvent()

void openmsx::MSXEventDistributor::distributeEvent ( const Event 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.

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

MSXEventDistributor & openmsx::MSXEventDistributor::operator= ( 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(), openmsx::SG1000Pause::SG1000Pause(), 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::Keyboard::~Keyboard(), openmsx::MSXCommandController::~MSXCommandController(), openmsx::SG1000Pause::~SG1000Pause(), and openmsx::VideoLayer::~VideoLayer().


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