diff options
author | David Robillard <d@drobilla.net> | 2020-11-28 12:32:24 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-28 12:45:57 +0100 |
commit | db5d1f603e0dd3076444f27008fcf1a61a4e151c (patch) | |
tree | 78af24e87c81e54fab14a59389adea859577f49e /src/PortID.hpp | |
parent | 0ae4276ac187a9a361950f26bd67eb2d54636aff (diff) | |
download | patchage-db5d1f603e0dd3076444f27008fcf1a61a4e151c.tar.gz patchage-db5d1f603e0dd3076444f27008fcf1a61a4e151c.tar.bz2 patchage-db5d1f603e0dd3076444f27008fcf1a61a4e151c.zip |
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.
Diffstat (limited to 'src/PortID.hpp')
-rw-r--r-- | src/PortID.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 <iostream> #include <string> #include <tuple> +#include <utility> /// 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<PortID::Type> +{ + size_t operator()(const PortID::Type& v) const noexcept + { + return hash<unsigned>()(static_cast<unsigned>(v)); + } +}; + +} // namespace std + #endif // PATCHAGE_PORTID_HPP |