From db5d1f603e0dd3076444f27008fcf1a61a4e151c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Nov 2020 12:32:24 +0100 Subject: Factor out Connector from PatchageCanvas This finally breaks the dependency of the canvas on the entire application, and fixes the confusing situation where it wasn't clear whether connect/disconnect methods made/broke connections on the canvas or on the system. --- src/PortID.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/PortID.hpp') diff --git a/src/PortID.hpp b/src/PortID.hpp index efdd78d..84c08a4 100644 --- a/src/PortID.hpp +++ b/src/PortID.hpp @@ -21,6 +21,7 @@ #include #include #include +#include /// An ID for some port on a client (program) struct PortID @@ -133,4 +134,17 @@ operator<(const PortID& lhs, const PortID& rhs) return false; } +namespace std { + +template<> +struct hash +{ + size_t operator()(const PortID::Type& v) const noexcept + { + return hash()(static_cast(v)); + } +}; + +} // namespace std + #endif // PATCHAGE_PORTID_HPP -- cgit v1.2.1