From 8d1dacd95115dde2e3a1b7b64d4352f84cb415e1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 25 Jul 2017 20:01:30 -0400 Subject: [PATCH] Clean ups along the Electron::Tape line: ensured that the ClockReceiver is opted into only once, and that its `run_for` propagates all the way along the chain. --- Machines/Electron/Tape.hpp | 2 +- Storage/Tape/Tape.hpp | 4 +++- Storage/TimedEventLoop.hpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Machines/Electron/Tape.hpp b/Machines/Electron/Tape.hpp index 22e5e5f88..37bff3d55 100644 --- a/Machines/Electron/Tape.hpp +++ b/Machines/Electron/Tape.hpp @@ -19,13 +19,13 @@ namespace Electron { class Tape: - public ClockReceiver, public Storage::Tape::TapePlayer, public Storage::Tape::Acorn::Shifter::Delegate { public: Tape(); void run_for(const Cycles &cycles); + using Storage::Tape::TapePlayer::run_for; uint8_t get_data_register(); void set_data_register(uint8_t value); diff --git a/Storage/Tape/Tape.hpp b/Storage/Tape/Tape.hpp index f978fb55e..f35b06f5f 100644 --- a/Storage/Tape/Tape.hpp +++ b/Storage/Tape/Tape.hpp @@ -92,7 +92,7 @@ class Tape { Will call @c process_input_pulse instantaneously upon reaching *the end* of a pulse. Therefore a subclass can decode pulses into data within process_input_pulse, using the supplied pulse's @c length and @c type. */ -class TapePlayer: public ClockReceiver, public TimedEventLoop { +class TapePlayer: public TimedEventLoop { public: TapePlayer(unsigned int input_clock_rate); @@ -101,6 +101,8 @@ class TapePlayer: public ClockReceiver, public TimedEventLoop { std::shared_ptr get_tape(); void run_for(const Cycles &cycles); + using TimedEventLoop::run_for; + void run_for_input_pulse(); protected: diff --git a/Storage/TimedEventLoop.hpp b/Storage/TimedEventLoop.hpp index 8659e8e1f..5793e4567 100644 --- a/Storage/TimedEventLoop.hpp +++ b/Storage/TimedEventLoop.hpp @@ -48,6 +48,7 @@ namespace Storage { Advances the event loop by @c number_of_cycles cycles. */ void run_for(const Cycles &cycles); + using ClockReceiver::run_for; /*! @returns the number of whole cycles remaining until the next event is triggered.