From 77a9beca75debd2d87d735fc4fe847694eee6f13 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Feb 2010 20:40:13 +0000 Subject: Work on contexts and polymorphic ports. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2492 a436a847-0d15-0410-975c-d299462d15a1 --- src/common/interface/Port.hpp | 10 +++++++++- src/common/interface/PortType.hpp | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/interface/Port.hpp b/src/common/interface/Port.hpp index c7029095..06272b6f 100644 --- a/src/common/interface/Port.hpp +++ b/src/common/interface/Port.hpp @@ -18,6 +18,7 @@ #ifndef INGEN_INTERFACE_PORT_HPP #define INGEN_INTERFACE_PORT_HPP +#include #include #include "GraphObject.hpp" #include "PortType.hpp" @@ -37,9 +38,16 @@ namespace Shared { class Port : public virtual GraphObject { public: + typedef std::set PortTypes; + + virtual const PortTypes& types() const = 0; + + inline bool is_a(PortType type) const { return types().find(type) != types().end(); } + + virtual bool supports(const Raul::URI& value_type) const = 0; + virtual uint32_t index() const = 0; virtual bool is_input() const = 0; - virtual Shared::PortType type() const = 0; virtual const Raul::Atom& value() const = 0; }; diff --git a/src/common/interface/PortType.hpp b/src/common/interface/PortType.hpp index e1d51e21..19558adc 100644 --- a/src/common/interface/PortType.hpp +++ b/src/common/interface/PortType.hpp @@ -68,6 +68,7 @@ public: inline bool operator!=(const Symbol& symbol) const { return (_symbol != symbol); } inline bool operator==(const PortType& type) const { return (_symbol == type._symbol); } inline bool operator!=(const PortType& type) const { return (_symbol != type._symbol); } + inline bool operator<(const PortType& type) const { return (_symbol < type._symbol); } inline bool is_audio() { return _symbol == AUDIO; } inline bool is_control() { return _symbol == CONTROL; } -- cgit v1.2.1