diff --git a/src/kaleidoscope/simulator/Executor.h b/src/kaleidoscope/simulator/Executor.h index 9b3851a6..925a5d33 100644 --- a/src/kaleidoscope/simulator/Executor.h +++ b/src/kaleidoscope/simulator/Executor.h @@ -39,7 +39,7 @@ uint8_t toKeycode(Key key) { } // namespace simulator } // namespace kaleidoscope -#include "kaleidoscope/simulator/Framework.h" +#include "kaleidoscope/simulator/Interface.h" #include "kaleidoscope/simulator/executor/Executor.h" #include "kaleidoscope/simulator/executor/AglaisInterface.h" #include "kaleidoscope/simulator/interface/Visualization.h" diff --git a/src/kaleidoscope/simulator/Interface.h b/src/kaleidoscope/simulator/Interface.h index 399d0eb2..902c85d4 100644 --- a/src/kaleidoscope/simulator/Interface.h +++ b/src/kaleidoscope/simulator/Interface.h @@ -20,7 +20,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "kaleidoscope/simulator/interface/Visualization.h" #include "kaleidoscope/simulator/interface/LED_Checks.h" diff --git a/src/kaleidoscope/simulator/executor/AglaisInterface.cpp b/src/kaleidoscope/simulator/executor/AglaisInterface.cpp index b2e74830..fe9cf851 100644 --- a/src/kaleidoscope/simulator/executor/AglaisInterface.cpp +++ b/src/kaleidoscope/simulator/executor/AglaisInterface.cpp @@ -26,7 +26,7 @@ #include "kaleidoscope/simulator/LogProtocol.h" #include "kaleidoscope/simulator/log_protocol/Consumer_.h" #include "kaleidoscope/simulator/interface/actions/generic_report/AssertReportEquals.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "HID-Settings.h" namespace kaleidoscope { @@ -38,7 +38,7 @@ namespace executor { class SimulatorConsumerAdaptor : public log_protocol::Consumer_ { public: - SimulatorConsumerAdaptor(interface::Simulator &simulator) + SimulatorConsumerAdaptor(interface::Simulator_ &simulator) : simulator_(simulator) {} @@ -144,11 +144,11 @@ class SimulatorConsumerAdaptor : public log_protocol::Consumer_ { private: - interface::Simulator &simulator_; + interface::Simulator_ &simulator_; }; -void processAglaisDocument(const char *code, interface::Simulator &simulator) { +void processAglaisDocument(const char *code, interface::Simulator_ &simulator) { auto rwqa_state = simulator.getErrorIfReportWithoutQueuedActions(); log_protocol::LogProtocol a; diff --git a/src/kaleidoscope/simulator/executor/AglaisInterface.h b/src/kaleidoscope/simulator/executor/AglaisInterface.h index f25f6f4b..db9dcca3 100644 --- a/src/kaleidoscope/simulator/executor/AglaisInterface.h +++ b/src/kaleidoscope/simulator/executor/AglaisInterface.h @@ -23,12 +23,12 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; } // namespace interface namespace executor { -void processAglaisDocument(const char *code, interface::Simulator &sim); +void processAglaisDocument(const char *code, interface::Simulator_ &sim); } // namespace executor } // namespace simulator diff --git a/src/kaleidoscope/simulator/executor/Executor.cpp b/src/kaleidoscope/simulator/executor/Executor.cpp index 55279b3d..4713b43e 100644 --- a/src/kaleidoscope/simulator/executor/Executor.cpp +++ b/src/kaleidoscope/simulator/executor/Executor.cpp @@ -34,7 +34,7 @@ namespace kaleidoscope { namespace simulator { namespace executor { -Executor::Executor(std::ostream &out) : interface::Simulator{out} { +Executor::Executor(std::ostream &out) : interface::Simulator_{out} { this->setCore( std::shared_ptr { new SimulatorCore{} diff --git a/src/kaleidoscope/simulator/executor/Executor.h b/src/kaleidoscope/simulator/executor/Executor.h index 78db024e..b0f0cf4d 100644 --- a/src/kaleidoscope/simulator/executor/Executor.h +++ b/src/kaleidoscope/simulator/executor/Executor.h @@ -20,7 +20,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" /// @namespace kaleidoscope /// @@ -34,7 +34,7 @@ namespace executor { /// @brief A Kaleidoscope specific simulator class. /// -class Executor : public interface::Simulator { +class Executor : public interface::Simulator_ { public: /// @brief Access the global simulator singleton. diff --git a/src/kaleidoscope/simulator/executor/actions/generic_report/GenerateHostEvent.cpp b/src/kaleidoscope/simulator/executor/actions/generic_report/GenerateHostEvent.cpp index 8c3c1ef8..64569811 100644 --- a/src/kaleidoscope/simulator/executor/actions/generic_report/GenerateHostEvent.cpp +++ b/src/kaleidoscope/simulator/executor/actions/generic_report/GenerateHostEvent.cpp @@ -23,7 +23,7 @@ #include "kaleidoscope/simulator/executor/reports/KeyboardReport.h" #include "kaleidoscope/simulator/executor/reports/MouseReport.h" #include "kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #ifdef __unix__ /* __unix__ is usually defined by compilers targeting Unix systems */ @@ -82,7 +82,7 @@ class KeyboardReportEventCheck { public: - KeyboardReportEventCheck(const interface::Simulator &simulator, + KeyboardReportEventCheck(const interface::Simulator_ &simulator, Display *display, const KeyboardReport &previous_report, const KeyboardReport ¤t_report) @@ -140,7 +140,7 @@ class KeyboardReportEventCheck { private: - const interface::Simulator &simulator_; + const interface::Simulator_ &simulator_; Display *display_; const KeyboardReport::ReportDataType &previous_report_data_; const KeyboardReport::ReportDataType ¤t_report_data_; @@ -150,7 +150,7 @@ class BootKeyboardReportEventCheck { public: - BootKeyboardReportEventCheck(const interface::Simulator &simulator, + BootKeyboardReportEventCheck(const interface::Simulator_ &simulator, Display *display, const BootKeyboardReport &previous_report, const BootKeyboardReport ¤t_report) @@ -231,7 +231,7 @@ class BootKeyboardReportEventCheck { private: - const interface::Simulator &simulator_; + const interface::Simulator_ &simulator_; Display *display_; const BootKeyboardReport::ReportDataType &previous_report_data_; const BootKeyboardReport::ReportDataType ¤t_report_data_; diff --git a/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.cpp b/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.cpp index db14e04d..f2575f36 100644 --- a/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.cpp +++ b/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.cpp @@ -19,7 +19,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { @@ -104,7 +104,7 @@ bool AbsoluteMouseReport::isEmpty() const { && (report_data_.wheel == 0); } -void AbsoluteMouseReport::dump(const interface::Simulator &simulator, const char *add_indent) const { +void AbsoluteMouseReport::dump(const interface::Simulator_ &simulator, const char *add_indent) const { simulator.log() << add_indent << "Absolute mouse report content:"; simulator.log() << add_indent << " left button: " << this->isLeftButtonPressed(); simulator.log() << add_indent << " middle button: " << this->isMiddleButtonPressed(); diff --git a/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.h b/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.h index 8cbb4493..d462b467 100644 --- a/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.h +++ b/src/kaleidoscope/simulator/executor/reports/AbsoluteMouseReport.h @@ -133,7 +133,7 @@ class AbsoluteMouseReport : public interface::AbsoluteMouseReport_ { /// to the simulator's log stream. /// @param add_indent An additional indentation string. /// - virtual void dump(const interface::Simulator &simulator, const char *add_indent = "") const override; + virtual void dump(const interface::Simulator_ &simulator, const char *add_indent = "") const override; /// @brief Associates the object with new report data. /// @param report_data The new report data struct. diff --git a/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.cpp b/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.cpp index 9feb3374..5aa5e1b7 100644 --- a/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.cpp +++ b/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.cpp @@ -26,7 +26,7 @@ #include "kaleidoscope/simulator/executor/reports/BootKeyboardReport.h" #include "kaleidoscope/simulator/executor/aux/exceptions.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "kaleidoscope/simulator/interface/SimulatorCore_.h" #include "MultiReport/Keyboard.h" @@ -171,7 +171,7 @@ BootKeyboardReport if((bitfield) & 1<<7) stream << str7; void BootKeyboardReport -::dump(const interface::Simulator &simulator, const char *add_indent) const { +::dump(const interface::Simulator_ &simulator, const char *add_indent) const { bool anything = false; if (report_data_.modifiers) { anything = true; diff --git a/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.h b/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.h index 8af9f7a2..a28774fb 100644 --- a/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.h +++ b/src/kaleidoscope/simulator/executor/reports/BootKeyboardReport.h @@ -122,7 +122,7 @@ class BootKeyboardReport : public interface::BootKeyboardReport_ { /// to the simulator's log stream. /// @param add_indent An additional indentation string. /// - virtual void dump(const interface::Simulator &simulator, const char *add_indent = "") const override; + virtual void dump(const interface::Simulator_ &simulator, const char *add_indent = "") const override; /// @brief Associates the object with new report data. /// @param report_data The new report data struct. diff --git a/src/kaleidoscope/simulator/executor/reports/KeyboardReport.cpp b/src/kaleidoscope/simulator/executor/reports/KeyboardReport.cpp index 7a2d1a02..813c760a 100644 --- a/src/kaleidoscope/simulator/executor/reports/KeyboardReport.cpp +++ b/src/kaleidoscope/simulator/executor/reports/KeyboardReport.cpp @@ -26,7 +26,7 @@ #include "kaleidoscope/simulator/executor/reports/KeyboardReport.h" #include "kaleidoscope/simulator/executor/aux/exceptions.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include @@ -174,7 +174,7 @@ KeyboardReport void KeyboardReport -::dump(const interface::Simulator &simulator, const char *add_indent) const { +::dump(const interface::Simulator_ &simulator, const char *add_indent) const { bool anything = false; if (report_data_.modifiers) anything = true; else for (int i = 0; i < KEY_BYTES; i++) if (report_data_.keys[i]) { diff --git a/src/kaleidoscope/simulator/executor/reports/KeyboardReport.h b/src/kaleidoscope/simulator/executor/reports/KeyboardReport.h index 679a9484..bb15b3b4 100644 --- a/src/kaleidoscope/simulator/executor/reports/KeyboardReport.h +++ b/src/kaleidoscope/simulator/executor/reports/KeyboardReport.h @@ -124,7 +124,7 @@ class KeyboardReport : public interface::KeyboardReport_ { /// to the simulator's log stream. /// @param add_indent An additional indentation string. /// - virtual void dump(const interface::Simulator &simulator, const char *add_indent = "") const override; + virtual void dump(const interface::Simulator_ &simulator, const char *add_indent = "") const override; /// @brief Associates the object with new report data. /// @param report_data The new report data struct. diff --git a/src/kaleidoscope/simulator/executor/reports/MouseReport.cpp b/src/kaleidoscope/simulator/executor/reports/MouseReport.cpp index 06239ab6..a659d304 100644 --- a/src/kaleidoscope/simulator/executor/reports/MouseReport.cpp +++ b/src/kaleidoscope/simulator/executor/reports/MouseReport.cpp @@ -20,7 +20,7 @@ #include "kaleidoscope/simulator/executor/reports/MouseReport.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { @@ -96,7 +96,7 @@ bool MouseReport::isEmpty() const { && (report_data_.hWheel == 0); } -void MouseReport::dump(const interface::Simulator &simulator, const char *add_indent) const { +void MouseReport::dump(const interface::Simulator_ &simulator, const char *add_indent) const { simulator.log() << add_indent << "Mouse report content:"; simulator.log() << add_indent << " left button: " << this->isLeftButtonPressed(); simulator.log() << add_indent << " middle button: " << this->isMiddleButtonPressed(); diff --git a/src/kaleidoscope/simulator/executor/reports/MouseReport.h b/src/kaleidoscope/simulator/executor/reports/MouseReport.h index b86dcf9e..7748eb76 100644 --- a/src/kaleidoscope/simulator/executor/reports/MouseReport.h +++ b/src/kaleidoscope/simulator/executor/reports/MouseReport.h @@ -130,7 +130,7 @@ class MouseReport : public interface::MouseReport_ { /// to the simulator's log stream. /// @param add_indent An additional indentation string. /// - virtual void dump(const interface::Simulator &simulator, const char *add_indent = "") const override; + virtual void dump(const interface::Simulator_ &simulator, const char *add_indent = "") const override; /// @brief Associates the object with new report data. /// @param report_data The new report data struct. diff --git a/src/kaleidoscope/simulator/interface/ActionContainer.h b/src/kaleidoscope/simulator/interface/ActionContainer.h index f063608b..6a869717 100644 --- a/src/kaleidoscope/simulator/interface/ActionContainer.h +++ b/src/kaleidoscope/simulator/interface/ActionContainer.h @@ -35,7 +35,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief An auxiliary class that represents a container of action objects. /// @@ -49,7 +49,7 @@ class ActionContainer { /// @brief Constructor. /// @param simulator The associated Simulator object. /// - ActionContainer(Simulator &simulator) + ActionContainer(Simulator_ &simulator) : simulator_(simulator) {} @@ -157,7 +157,7 @@ class ActionContainer { private: - Simulator &simulator_; + Simulator_ &simulator_; std::deque> container_; }; diff --git a/src/kaleidoscope/simulator/interface/LED_Checks.cpp b/src/kaleidoscope/simulator/interface/LED_Checks.cpp index d4c471b4..c91b4fa0 100644 --- a/src/kaleidoscope/simulator/interface/LED_Checks.cpp +++ b/src/kaleidoscope/simulator/interface/LED_Checks.cpp @@ -19,7 +19,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/interface/LED_Checks.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "kaleidoscope/simulator/interface/SimulatorCore_.h" #include @@ -28,7 +28,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -void dumpKeyLEDState(const Simulator &simulator) { +void dumpKeyLEDState(const Simulator_ &simulator) { std::cout << "const uint8_t key_led_colors[][3] = {\n"; @@ -56,7 +56,7 @@ void dumpKeyLEDState(const Simulator &simulator) { std::cout << "};\n\n"; } -void assertKeyLEDState(const Simulator &simulator, +void assertKeyLEDState(const Simulator_ &simulator, const uint8_t key_led_colors[][3]) { const auto &simulator_core = simulator.getCore(); diff --git a/src/kaleidoscope/simulator/interface/LED_Checks.h b/src/kaleidoscope/simulator/interface/LED_Checks.h index d35cc813..3e648a48 100644 --- a/src/kaleidoscope/simulator/interface/LED_Checks.h +++ b/src/kaleidoscope/simulator/interface/LED_Checks.h @@ -26,18 +26,18 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief Dumps the state of the key LEDs as C++ code /// -void dumpKeyLEDState(const Simulator &simulator); +void dumpKeyLEDState(const Simulator_ &simulator); /// @brief Compares the current state of the key LEDs to a representation /// stored in an array. /// @param key_led_colors An array of key LED state data to compare the current /// state with. /// -void assertKeyLEDState(const Simulator &simulator, +void assertKeyLEDState(const Simulator_ &simulator, const uint8_t key_led_colors[][3]); } // namespace interface diff --git a/src/kaleidoscope/simulator/interface/Simulator.cpp b/src/kaleidoscope/simulator/interface/Simulator_.cpp similarity index 88% rename from src/kaleidoscope/simulator/interface/Simulator.cpp rename to src/kaleidoscope/simulator/interface/Simulator_.cpp index e1485ef3..8e94d504 100644 --- a/src/kaleidoscope/simulator/interface/Simulator.cpp +++ b/src/kaleidoscope/simulator/interface/Simulator_.cpp @@ -20,7 +20,7 @@ #include "Arduino.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "kaleidoscope/simulator/interface/ActionContainer_Impl.h" #include "kaleidoscope/simulator/interface/actions/Action_.h" #include "kaleidoscope/simulator/interface/aux/WallTimer.h" @@ -86,7 +86,7 @@ void SimulatorStream_::reactOnLineEnd() { this->getOStream() << "\n"; } -ErrorStream::ErrorStream(const Simulator *simulator) +ErrorStream::ErrorStream(const Simulator_ *simulator) : SimulatorStream_(simulator) { auto &out = this->getOStream(); @@ -119,7 +119,7 @@ void ErrorStream::reactOnLineStart() { this->getOStream() << "!!! "; } -DebugStream::DebugStream(const Simulator *simulator) +DebugStream::DebugStream(const Simulator_ *simulator) : SimulatorStream_(simulator) { if (this->mute()) { return; @@ -155,7 +155,7 @@ void DebugStream::reactOnLineStart() { this->getOStream() << "***Debug: "; } -LogStream::LogStream(const Simulator *simulator) +LogStream::LogStream(const Simulator_ *simulator) : SimulatorStream_(simulator) { } @@ -167,7 +167,7 @@ LogStream::~LogStream() { this->getOStream() << "\n"; } -HeaderStream::HeaderStream(const Simulator *simulator) +HeaderStream::HeaderStream(const Simulator_ *simulator) : SimulatorStream_(simulator) { if (this->mute()) { return; @@ -205,7 +205,7 @@ void HeaderStream::reactOnLineStart() { this->getOStream() << "### "; } -Test::Test(Simulator *simulator, const char *name) +Test::Test(Simulator_ *simulator, const char *name) : simulator_(simulator), name_(name), error_count_start_(simulator->getErrorCount()) { @@ -222,10 +222,10 @@ Test::~Test() { } } -Simulator::Simulator(std::ostream &out, - bool debug, - int cycle_duration, - bool abort_on_first_error) +Simulator_::Simulator_(std::ostream &out, + bool debug, + int cycle_duration, + bool abort_on_first_error) : out_{&out}, debug_{debug}, @@ -245,7 +245,7 @@ Simulator::Simulator(std::ostream &out, this->headerText(); } -Simulator::~Simulator() { +Simulator_::~Simulator_() { this->footerText(); if (!test_success_) { @@ -254,24 +254,24 @@ Simulator::~Simulator() { } } -void Simulator::pressKey(uint8_t row, uint8_t col) { +void Simulator_::pressKey(uint8_t row, uint8_t col) { this->log() << "+ Activating key (" << (unsigned)row << ", " << (unsigned)col << ")"; simulator_core_->pressKey(row, col); } -void Simulator::releaseKey(uint8_t row, uint8_t col) { +void Simulator_::releaseKey(uint8_t row, uint8_t col) { this->log() << "+ Releasing key (" << (unsigned)row << ", " << (unsigned)col << ")"; simulator_core_->releaseKey(row, col); } -void Simulator::tapKey(uint8_t row, uint8_t col) { +void Simulator_::tapKey(uint8_t row, uint8_t col) { this->log() << "+- Tapping key (" << (unsigned)row << ", " << (unsigned)col << ")"; simulator_core_->tapKey(row, col); } -void Simulator::multiTapKeyInternal(int num_taps, uint8_t row, uint8_t col, - int tap_interval_cycles, - std::shared_ptr after_tap_and_cycles_action) { +void Simulator_::multiTapKeyInternal(int num_taps, uint8_t row, uint8_t col, + int tap_interval_cycles, + std::shared_ptr after_tap_and_cycles_action) { if (after_tap_and_cycles_action) { after_tap_and_cycles_action->setSimulator(this); } @@ -302,7 +302,7 @@ void Simulator::multiTapKeyInternal(int num_taps, uint8_t row, uint8_t col, } } -void Simulator::clearAllKeys() { +void Simulator_::clearAllKeys() { this->log() << "- Clearing all keys"; uint8_t rows = 0, cols = 0; @@ -316,7 +316,7 @@ void Simulator::clearAllKeys() { } } -void Simulator::cycle(bool suppress_cycle_info_log) { +void Simulator_::cycle(bool suppress_cycle_info_log) { if (!suppress_cycle_info_log) { this->log() << "Running single scan cycle"; } @@ -328,8 +328,8 @@ void Simulator::cycle(bool suppress_cycle_info_log) { } } -void Simulator::cyclesInternal(int n, - const std::vector> &cycle_action_list) { +void Simulator_::cyclesInternal(int n, + const std::vector> &cycle_action_list) { if (n == 0) { n = scan_cycles_default_count_; } @@ -344,7 +344,7 @@ void Simulator::cyclesInternal(int n, this->log() << ""; } -void Simulator::advanceTimeBy(Simulator::TimeType delta_t) { +void Simulator_::advanceTimeBy(Simulator_::TimeType delta_t) { this->checkCycleDurationSet(); @@ -353,13 +353,13 @@ void Simulator::advanceTimeBy(Simulator::TimeType delta_t) { this->skipTimeInternal(delta_t); } -void Simulator::skipTimeInternal(Simulator::TimeType delta_t) { +void Simulator_::skipTimeInternal(Simulator_::TimeType delta_t) { auto start_cycle = cycle_id_; auto start_time = time_; - Simulator::TimeType elapsed_time = 0; + Simulator_::TimeType elapsed_time = 0; while (elapsed_time < delta_t) { this->cycleInternal(true /* only_log_reports */); elapsed_time = time_ - start_time; @@ -370,7 +370,7 @@ void Simulator::skipTimeInternal(Simulator::TimeType delta_t) { this->log() << ""; } -void Simulator::advanceTimeTo(TimeType time) { +void Simulator_::advanceTimeTo(TimeType time) { if (time <= time_) { this->error() << "Failed cycling to time " << time << " ms. Target time is in the past."; return; @@ -383,12 +383,12 @@ void Simulator::advanceTimeTo(TimeType time) { this->skipTimeInternal(delta_t); } -void Simulator::init() { +void Simulator_::init() { this->clearAllKeys(); simulator_core_->init(); } -bool Simulator::checkStatus() { +bool Simulator_::checkStatus() { if (!queued_report_actions_.empty()) { this->error() << "There are " << queued_report_actions_.size() @@ -415,7 +415,7 @@ bool Simulator::checkStatus() { return false; } -void Simulator::headerText() { +void Simulator_::headerText() { // Foreground color yellow // @@ -440,7 +440,7 @@ void Simulator::headerText() { this->getOStream() << "\x1B[0m"; } -void Simulator::footerText() { +void Simulator_::footerText() { // Foreground color yellow // @@ -471,7 +471,7 @@ void Simulator::footerText() { this->getOStream() << "\x1B[0m"; } -void Simulator::cycleInternal(bool only_log_reports) { +void Simulator_::cycleInternal(bool only_log_reports) { ++cycle_id_; n_reports_in_cycle_ = 0; @@ -516,14 +516,14 @@ void Simulator::cycleInternal(bool only_log_reports) { } } -void Simulator::checkCycleDurationSet() { +void Simulator_::checkCycleDurationSet() { if (cycle_duration_ == 0) { this->error() << "Please set test.cycle_duration_ to a value in " "[ms] greater zero before using time based testing"; } } -void Simulator::assertNothingQueued() const { +void Simulator_::assertNothingQueued() const { if (!queued_report_actions_.empty()) { this->error() << "Report actions are left in queue"; } @@ -533,14 +533,14 @@ void Simulator::assertNothingQueued() const { } } -void Simulator::assertCondition(bool cond, const char *action_code) const { +void Simulator_::assertCondition(bool cond, const char *action_code) const { if (!cond) { this->error() << "Action failed: " << action_code; } } -void Simulator::runRealtime(TimeType duration, - const std::function &cycle_function) { +void Simulator_::runRealtime(TimeType duration, + const std::function &cycle_function) { auto n_cycles = duration / cycle_duration_; aux::WallTimer timer; @@ -591,12 +591,12 @@ class DataCollectorThread { uint16_t key_bitfield_[n_bytes_per_row] = {}; std::mutex mutex_; - friend class Simulator; + friend class Simulator_; }; -void Simulator::runRemoteControlled(const std::function &cycle_callback, - bool realtime - ) { +void Simulator_::runRemoteControlled(const std::function &cycle_callback, + bool realtime + ) { aux::WallTimer timer; DataCollectorThread dct; diff --git a/src/kaleidoscope/simulator/interface/Simulator.h b/src/kaleidoscope/simulator/interface/Simulator_.h similarity index 97% rename from src/kaleidoscope/simulator/interface/Simulator.h rename to src/kaleidoscope/simulator/interface/Simulator_.h index fe4c8eec..930291e3 100644 --- a/src/kaleidoscope/simulator/interface/Simulator.h +++ b/src/kaleidoscope/simulator/interface/Simulator_.h @@ -37,7 +37,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; class SimulatorCore_; class Action_; @@ -99,7 +99,7 @@ class SimulatorStream_ { /// struct Endl {}; - SimulatorStream_(const Simulator *simulator) : simulator_(simulator) {} + SimulatorStream_(const Simulator_ *simulator) : simulator_(simulator) {} virtual ~SimulatorStream_() {} @@ -128,7 +128,7 @@ class SimulatorStream_ { protected: - const Simulator *simulator_; + const Simulator_ *simulator_; private: @@ -141,7 +141,7 @@ class ErrorStream : public SimulatorStream_ { public: - ErrorStream(const Simulator *simulator); + ErrorStream(const Simulator_ *simulator); template ErrorStream &operator<<(const _T &t) { @@ -162,7 +162,7 @@ class DebugStream : public SimulatorStream_ { public: - DebugStream(const Simulator *simulator); + DebugStream(const Simulator_ *simulator); template DebugStream &operator<<(const _T &t) { @@ -186,7 +186,7 @@ class LogStream : public SimulatorStream_ { public: - LogStream(const Simulator *simulator); + LogStream(const Simulator_ *simulator); virtual ~LogStream() override; template @@ -205,7 +205,7 @@ class HeaderStream : public SimulatorStream_ { public: - HeaderStream(const Simulator *simulator); + HeaderStream(const Simulator_ *simulator); template HeaderStream &operator<<(const _T &t) { @@ -229,12 +229,12 @@ class Test { public: - Test(Simulator *simulator, const char *name); + Test(Simulator_ *simulator, const char *name); ~Test(); private: - Simulator *simulator_; + Simulator_ *simulator_; const char *name_; int error_count_start_; }; @@ -242,7 +242,7 @@ class Test { /// @brief The main simulator object. /// -class Simulator { +class Simulator_ { public: @@ -288,7 +288,7 @@ class Simulator { public: - ~Simulator(); + ~Simulator_(); /// @details If the ErrorIfReportWithoutQueuedActions is enabled /// it is considered an error if no actions are queued @@ -712,10 +712,10 @@ class Simulator { /// @param abort_on_first_error If enabled, testing is aborted after /// the first error occurred. /// - Simulator(std::ostream &out, - bool debug = false, - int cycle_duration = 1, - bool abort_on_first_error = false); + Simulator_(std::ostream &out, + bool debug = false, + int cycle_duration = 1, + bool abort_on_first_error = false); protected: diff --git a/src/kaleidoscope/simulator/interface/Visualization.cpp b/src/kaleidoscope/simulator/interface/Visualization.cpp index 22f6ef0e..6237c9ae 100644 --- a/src/kaleidoscope/simulator/interface/Visualization.cpp +++ b/src/kaleidoscope/simulator/interface/Visualization.cpp @@ -19,7 +19,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/interface/Visualization.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "kaleidoscope/simulator/interface/SimulatorCore_.h" #include "kaleidoscope/simulator/interface/aux/terminal_escape_sequences.h" @@ -113,7 +113,7 @@ class KeyboardRenderer { const SimulatorCore_ &simulator_core_; }; -void renderKeyboard(const Simulator &simulator, const char *ascii_keyboard) { +void renderKeyboard(const Simulator_ &simulator, const char *ascii_keyboard) { KeyAddrToKeyString lookup; KeyboardRenderer kr{simulator.getCore()}; diff --git a/src/kaleidoscope/simulator/interface/Visualization.h b/src/kaleidoscope/simulator/interface/Visualization.h index bdd05395..08382331 100644 --- a/src/kaleidoscope/simulator/interface/Visualization.h +++ b/src/kaleidoscope/simulator/interface/Visualization.h @@ -24,7 +24,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief Renders a keyboard's asscii representation. /// @@ -32,7 +32,7 @@ class Simulator; /// @param ascii_keyboard The ascii representation of the keyboards /// key layout. /// -void renderKeyboard(const Simulator &simulator, const char *ascii_keyboard); +void renderKeyboard(const Simulator_ &simulator, const char *ascii_keyboard); } // namespace interface } // namespace simulator diff --git a/src/kaleidoscope/simulator/interface/actions/Action_.cpp b/src/kaleidoscope/simulator/interface/actions/Action_.cpp index a925f94b..94805850 100644 --- a/src/kaleidoscope/simulator/interface/actions/Action_.cpp +++ b/src/kaleidoscope/simulator/interface/actions/Action_.cpp @@ -20,7 +20,7 @@ #include "kaleidoscope/simulator/interface/actions/Action_.h" #include "kaleidoscope/simulator/interface/aux/demangle.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { diff --git a/src/kaleidoscope/simulator/interface/actions/Action_.h b/src/kaleidoscope/simulator/interface/actions/Action_.h index c3285e09..daf3611e 100644 --- a/src/kaleidoscope/simulator/interface/actions/Action_.h +++ b/src/kaleidoscope/simulator/interface/actions/Action_.h @@ -31,7 +31,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; class Report_; /// @private @@ -87,7 +87,7 @@ class Action_ { /// @brief Register the test simulator with the action. /// - virtual void setSimulator(const Simulator *simulator) { + virtual void setSimulator(const Simulator_ *simulator) { simulator_ = simulator; } @@ -96,7 +96,7 @@ class Action_ { /// /// @return A pointer to the current test simulator. /// - const Simulator *getSimulator() const { + const Simulator_ *getSimulator() const { return simulator_; } @@ -161,7 +161,7 @@ class Action_ { protected: bool valid_ = false; - const Simulator *simulator_ = nullptr; + const Simulator_ *simulator_ = nullptr; private: diff --git a/src/kaleidoscope/simulator/interface/actions/AssertElapsedTimeGreater.h b/src/kaleidoscope/simulator/interface/actions/AssertElapsedTimeGreater.h index 34cb81b4..41b70509 100644 --- a/src/kaleidoscope/simulator/interface/actions/AssertElapsedTimeGreater.h +++ b/src/kaleidoscope/simulator/interface/actions/AssertElapsedTimeGreater.h @@ -21,7 +21,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/interface/actions/Action_.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { @@ -38,7 +38,7 @@ class AssertElapsedTimeGreater { /// @param delta_t The amount of time that is asserted being elapsed. /// @param start_t An optional start point in time as reference (defaults to zero). /// - AssertElapsedTimeGreater(Simulator::TimeType delta_t, Simulator::TimeType start_t = 0) + AssertElapsedTimeGreater(Simulator_::TimeType delta_t, Simulator_::TimeType start_t = 0) : AssertElapsedTimeGreater(DelegateConstruction{}, delta_t, start_t) {} @@ -48,7 +48,7 @@ class AssertElapsedTimeGreater { public: - Action(Simulator::TimeType delta_t, Simulator::TimeType start_t = 0) + Action(Simulator_::TimeType delta_t, Simulator_::TimeType start_t = 0) : start_t_(start_t), delta_t_(delta_t) {} @@ -68,8 +68,8 @@ class AssertElapsedTimeGreater { private: - Simulator::TimeType start_t_ = .0; - Simulator::TimeType delta_t_ = .0; + Simulator_::TimeType start_t_ = .0; + Simulator_::TimeType delta_t_ = .0; }; SIMULATOR_AUTO_DEFINE_ACTION_INVENTORY(AssertElapsedTimeGreater) diff --git a/src/kaleidoscope/simulator/interface/actions/Grouped.cpp b/src/kaleidoscope/simulator/interface/actions/Grouped.cpp index c1f2c0fb..939606d0 100644 --- a/src/kaleidoscope/simulator/interface/actions/Grouped.cpp +++ b/src/kaleidoscope/simulator/interface/actions/Grouped.cpp @@ -19,7 +19,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/interface/actions/Grouped.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { diff --git a/src/kaleidoscope/simulator/interface/actions/Grouped.h b/src/kaleidoscope/simulator/interface/actions/Grouped.h index 5a0cf349..fb2ccbd7 100644 --- a/src/kaleidoscope/simulator/interface/actions/Grouped.h +++ b/src/kaleidoscope/simulator/interface/actions/Grouped.h @@ -20,7 +20,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" #include "kaleidoscope/simulator/interface/actions/Action_.h" #include "kaleidoscope/simulator/interface/actions/generic_report/ReportAction.h" @@ -59,7 +59,7 @@ class GroupedAction_ : public _ActionType { } } - virtual void setSimulator(const Simulator *simulator) override { + virtual void setSimulator(const Simulator_ *simulator) override { this->Action_::setSimulator(simulator); for (auto &action : actions_) { diff --git a/src/kaleidoscope/simulator/interface/actions/generic_report/AssertCycleGeneratesNReports.h b/src/kaleidoscope/simulator/interface/actions/generic_report/AssertCycleGeneratesNReports.h index b41c15fa..6095ceff 100644 --- a/src/kaleidoscope/simulator/interface/actions/generic_report/AssertCycleGeneratesNReports.h +++ b/src/kaleidoscope/simulator/interface/actions/generic_report/AssertCycleGeneratesNReports.h @@ -21,7 +21,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/interface/actions/Action_.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { diff --git a/src/kaleidoscope/simulator/interface/actions/generic_report/AssertReportEquals.h b/src/kaleidoscope/simulator/interface/actions/generic_report/AssertReportEquals.h index 3861dbcc..4525e730 100644 --- a/src/kaleidoscope/simulator/interface/actions/generic_report/AssertReportEquals.h +++ b/src/kaleidoscope/simulator/interface/actions/generic_report/AssertReportEquals.h @@ -21,7 +21,7 @@ #ifdef KALEIDOSCOPE_VIRTUAL_BUILD #include "kaleidoscope/simulator/interface/actions/generic_report/ReportAction.h" -#include "kaleidoscope/simulator/interface/Simulator.h" +#include "kaleidoscope/simulator/interface/Simulator_.h" namespace kaleidoscope { namespace simulator { diff --git a/src/kaleidoscope/simulator/interface/reports/AbsoluteMouseReport_.h b/src/kaleidoscope/simulator/interface/reports/AbsoluteMouseReport_.h index 1965f1aa..1d0cc957 100644 --- a/src/kaleidoscope/simulator/interface/reports/AbsoluteMouseReport_.h +++ b/src/kaleidoscope/simulator/interface/reports/AbsoluteMouseReport_.h @@ -34,7 +34,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief An interface hat facilitates analyzing absolute mouse reports. /// diff --git a/src/kaleidoscope/simulator/interface/reports/BootKeyboardReport_.h b/src/kaleidoscope/simulator/interface/reports/BootKeyboardReport_.h index 13c191b4..9f9243f5 100644 --- a/src/kaleidoscope/simulator/interface/reports/BootKeyboardReport_.h +++ b/src/kaleidoscope/simulator/interface/reports/BootKeyboardReport_.h @@ -35,7 +35,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief An interface hat facilitates analyzing boot keyboard reports. /// diff --git a/src/kaleidoscope/simulator/interface/reports/KeyboardReport_.h b/src/kaleidoscope/simulator/interface/reports/KeyboardReport_.h index c8541a8b..3012c1c2 100644 --- a/src/kaleidoscope/simulator/interface/reports/KeyboardReport_.h +++ b/src/kaleidoscope/simulator/interface/reports/KeyboardReport_.h @@ -35,7 +35,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief An interface hat facilitates analyzing keyboard reports. /// diff --git a/src/kaleidoscope/simulator/interface/reports/MouseReport_.h b/src/kaleidoscope/simulator/interface/reports/MouseReport_.h index 3a4e11b5..72eba855 100644 --- a/src/kaleidoscope/simulator/interface/reports/MouseReport_.h +++ b/src/kaleidoscope/simulator/interface/reports/MouseReport_.h @@ -34,7 +34,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; /// @brief An interface hat facilitates analyzing mouse reports. /// diff --git a/src/kaleidoscope/simulator/interface/reports/Report_.h b/src/kaleidoscope/simulator/interface/reports/Report_.h index 56a609c7..d4f7a3e2 100644 --- a/src/kaleidoscope/simulator/interface/reports/Report_.h +++ b/src/kaleidoscope/simulator/interface/reports/Report_.h @@ -34,7 +34,7 @@ namespace kaleidoscope { namespace simulator { namespace interface { -class Simulator; +class Simulator_; enum { AnyTypeReportTypeId = 0, @@ -74,7 +74,7 @@ class Report_ { /// to the simulator's log stream. /// @param add_indent An additional indentation string. /// - virtual void dump(const Simulator &simulator, const char *add_indent = "") const = 0; + virtual void dump(const Simulator_ &simulator, const char *add_indent = "") const = 0; static const char *typeString() { return "generic report";