From 75ee1ed27d5d2c60e867abef09ee920446ac13de Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 11 May 2021 12:04:36 -0400 Subject: Move drivers to a separate object Towards eliminating dependencies on the Patchage "god object". --- src/Reactor.hpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/Reactor.hpp') diff --git a/src/Reactor.hpp b/src/Reactor.hpp index 04b699d..9317b0a 100644 --- a/src/Reactor.hpp +++ b/src/Reactor.hpp @@ -18,19 +18,18 @@ #define PATCHAGE_REACTOR_HPP #include "Action.hpp" -#include "PortID.hpp" #include "SignalDirection.hpp" -#include - namespace patchage { +struct PortID; + class CanvasModule; class CanvasPort; -class Driver; +class ClientID; +class Drivers; class ILog; class Patchage; -class ClientID; /// Reacts to actions from the user class Reactor @@ -48,8 +47,6 @@ public: ~Reactor() = default; - void add_driver(PortID::Type type, Driver* driver); - void operator()(const action::ConnectPorts& action); void operator()(const action::DisconnectClient& action); void operator()(const action::DisconnectPort& action); @@ -64,9 +61,9 @@ private: CanvasModule* find_module(const ClientID& client, SignalDirection type); CanvasPort* find_port(const PortID& port); - Patchage& _patchage; - ILog& _log; - std::unordered_map _drivers; + Patchage& _patchage; + ILog& _log; + Drivers& _drivers; }; } // namespace patchage -- cgit v1.2.1