14 assert(listeners.empty());
19 return contains(listeners, listener);
24 assert(!isRegistered(&listener));
25 listeners.push_back(&listener);
36 recorder = &recorder_;
42 assert(recorder == &recorder_);
46void StateChangeDistributor::distribute(
const StateChange& event)
const
53 auto copy = listeners;
54 for (
auto& l : copy) {
55 if (isRegistered(l)) {
58 l->signalStateChange(event);
68 for (
auto& l : listeners) {
void stopReplay(EmuTime::param time) noexcept
void unregisterRecorder(ReverseManager &recorder)
void registerListener(StateChangeListener &listener)
(Un)registers the given object to receive state change events.
void registerRecorder(ReverseManager &recorder)
(Un)registers the given object to receive state change events.
void unregisterListener(StateChangeListener &listener)
void stopReplay(EmuTime::param time)
Explicitly stop replay.
~StateChangeDistributor()
Base class for all external MSX state changing events.
This file implemented 3 utility functions:
void move_pop_back(VECTOR &v, typename VECTOR::iterator it)
Erase the pointed to element from the given vector.
auto rfind_unguarded(RANGE &range, const VAL &val, Proj proj={})
Similar to the find(_if)_unguarded functions above, but searches from the back to front.
constexpr bool contains(ITER first, ITER last, const VAL &val)
Check if a range contains a given value, using linear search.