From 44f7ad5222d824d81dc743045d5887418847e74e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jan 2018 00:41:34 +0100 Subject: Add URI class and remove use of Raul::URI --- ingen/client/BlockModel.hpp | 6 +++--- ingen/client/ClientStore.hpp | 14 +++++++------- ingen/client/ObjectModel.hpp | 11 +++++------ ingen/client/PluginModel.hpp | 23 ++++++++++++----------- ingen/client/PluginUI.hpp | 4 ++-- ingen/client/PortModel.hpp | 2 +- ingen/client/SigClientInterface.hpp | 2 +- ingen/client/SocketClient.hpp | 4 ++-- ingen/client/ThreadedSigClientInterface.hpp | 5 +---- 9 files changed, 34 insertions(+), 37 deletions(-) (limited to 'ingen/client') diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index 22613eca..38e8987e 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -58,7 +58,7 @@ public: Node* port(uint32_t index) const; - const Raul::URI& plugin_uri() const { return _plugin_uri; } + const URI& plugin_uri() const { return _plugin_uri; } const Resource* plugin() const { return _plugin.get(); } Resource* plugin() { return _plugin.get(); } SPtr plugin_model() const { return _plugin; } @@ -86,7 +86,7 @@ protected: friend class ClientStore; BlockModel(URIs& uris, - const Raul::URI& plugin_uri, + const URI& plugin_uri, const Raul::Path& path); BlockModel(URIs& uris, SPtr plugin, @@ -103,7 +103,7 @@ protected: virtual void clear(); Ports _ports; ///< Vector of ports - Raul::URI _plugin_uri; ///< Plugin URI (if PluginModel is unknown) + URI _plugin_uri; ///< Plugin URI (if PluginModel is unknown) SPtr _plugin; ///< The plugin this block is an instance of private: diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 8850f401..797052ef 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -58,15 +58,15 @@ public: Log& log, SPtr emitter = SPtr()); - Raul::URI uri() const override { return Raul::URI("ingen:/clients/store"); } + URI uri() const override { return URI("ingen:/clients/store"); } SPtr object(const Raul::Path& path) const; - SPtr plugin(const Raul::URI& uri) const; - SPtr resource(const Raul::URI& uri) const; + SPtr plugin(const URI& uri) const; + SPtr resource(const URI& uri) const; void clear(); - typedef std::map< const Raul::URI, SPtr > Plugins; + typedef std::map< const URI, SPtr > Plugins; SPtr plugins() const { return _plugins; } SPtr plugins() { return _plugins; } void set_plugins(SPtr p) { _plugins = p; } @@ -94,13 +94,13 @@ public: INGEN_SIGNAL(new_object, void, SPtr); INGEN_SIGNAL(new_plugin, void, SPtr); - INGEN_SIGNAL(plugin_deleted, void, Raul::URI); + INGEN_SIGNAL(plugin_deleted, void, URI); private: SPtr _object(const Raul::Path& path); - SPtr _plugin(const Raul::URI& uri); + SPtr _plugin(const URI& uri); SPtr _plugin(const Atom& uri); - SPtr _resource(const Raul::URI& uri); + SPtr _resource(const URI& uri); void add_object(SPtr object); SPtr remove_object(const Raul::Path& path); diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index 4250efc5..a5a68f1e 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -27,7 +27,6 @@ #include "ingen/types.hpp" #include "raul/Path.hpp" -#include "raul/URI.hpp" #include "ingen/Node.hpp" #include "ingen/Resource.hpp" @@ -58,10 +57,10 @@ class INGEN_API ObjectModel : public Node public: bool is_a(const URIs::Quark& type) const; - const Atom& get_property(const Raul::URI& key) const; + const Atom& get_property(const URI& key) const; - void on_property(const Raul::URI& uri, const Atom& value); - void on_property_removed(const Raul::URI& uri, const Atom& value); + void on_property(const URI& uri, const Atom& value); + void on_property_removed(const URI& uri, const Atom& value); const Raul::Path& path() const { return _path; } const Raul::Symbol& symbol() const { return _symbol; } @@ -73,8 +72,8 @@ public: // Signals INGEN_SIGNAL(new_child, void, SPtr); INGEN_SIGNAL(removed_child, void, SPtr); - INGEN_SIGNAL(property, void, const Raul::URI&, const Atom&); - INGEN_SIGNAL(property_removed, void, const Raul::URI&, const Atom&); + INGEN_SIGNAL(property, void, const URI&, const Atom&); + INGEN_SIGNAL(property_removed, void, const URI&, const Atom&); INGEN_SIGNAL(destroyed, void); INGEN_SIGNAL(moved, void); diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp index 585ac7d7..61de0f1a 100644 --- a/ingen/client/PluginModel.hpp +++ b/ingen/client/PluginModel.hpp @@ -50,18 +50,19 @@ class INGEN_API PluginModel : public Ingen::Resource { public: PluginModel(URIs& uris, - const Raul::URI& uri, + const URI& uri, const Atom& type, const Ingen::Properties& properties); - const Atom& type() const { return _type; } - const Raul::URI type_uri() const { - return Raul::URI(_type.is_valid() - ? _uris.forge.str(_type, false) - : "http://www.w3.org/2002/07/owl#Nothing"); + const Atom& type() const { return _type; } + + const URI type_uri() const + { + return URI(_type.is_valid() ? _uris.forge.str(_type, false) + : "http://www.w3.org/2002/07/owl#Nothing"); } - virtual const Atom& get_property(const Raul::URI& key) const; + virtual const Atom& get_property(const URI& key) const; Raul::Symbol default_block_symbol() const; std::string human_name() const; @@ -70,7 +71,7 @@ public: typedef std::map ScalePoints; ScalePoints port_scale_points(uint32_t i) const; - typedef std::map Presets; + typedef std::map Presets; const Presets& presets() const { return _presets; } static LilvWorld* lilv_world() { return _lilv_world; } @@ -96,8 +97,8 @@ public: // Signals INGEN_SIGNAL(changed, void); - INGEN_SIGNAL(property, void, const Raul::URI&, const Atom&); - INGEN_SIGNAL(preset, void, const Raul::URI&, const std::string&); + INGEN_SIGNAL(property, void, const URI&, const Atom&); + INGEN_SIGNAL(preset, void, const URI&, const std::string&); bool fetched() const { return _fetched; } void set_fetched(bool f) { _fetched = f; } @@ -106,7 +107,7 @@ protected: friend class ClientStore; void set(SPtr p); - void add_preset(const Raul::URI& uri, const std::string& label); + void add_preset(const URI& uri, const std::string& label); private: std::string get_documentation(const LilvNode* subject, bool html) const; diff --git a/ingen/client/PluginUI.hpp b/ingen/client/PluginUI.hpp index 45475cfe..a98df61d 100644 --- a/ingen/client/PluginUI.hpp +++ b/ingen/client/PluginUI.hpp @@ -76,8 +76,8 @@ public: * engine and/or update itself as necessary. */ INGEN_SIGNAL(property_changed, void, - const Raul::URI&, // Subject - const Raul::URI&, // Predicate + const URI&, // Subject + const URI&, // Predicate const Atom&, // Object Resource::Graph); // Context diff --git a/ingen/client/PortModel.hpp b/ingen/client/PortModel.hpp index f03e5bc1..9ad37378 100644 --- a/ingen/client/PortModel.hpp +++ b/ingen/client/PortModel.hpp @@ -63,7 +63,7 @@ public: inline bool operator==(const PortModel& pm) const { return (path() == pm.path()); } - void on_property(const Raul::URI& uri, const Atom& value); + void on_property(const URI& uri, const Atom& value); // Signals INGEN_SIGNAL(value_changed, void, const Atom&); diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp index 4acc903b..6e94b257 100644 --- a/ingen/client/SigClientInterface.hpp +++ b/ingen/client/SigClientInterface.hpp @@ -46,7 +46,7 @@ class INGEN_API SigClientInterface : public Ingen::Interface, public: SigClientInterface() {} - Raul::URI uri() const override { return Raul::URI("ingen:/clients/sig"); } + URI uri() const override { return URI("ingen:/clients/sig"); } INGEN_SIGNAL(message, void, Message) diff --git a/ingen/client/SocketClient.hpp b/ingen/client/SocketClient.hpp index cceba9a3..8236200b 100644 --- a/ingen/client/SocketClient.hpp +++ b/ingen/client/SocketClient.hpp @@ -30,7 +30,7 @@ class INGEN_API SocketClient : public SocketWriter { public: SocketClient(World& world, - const Raul::URI& uri, + const URI& uri, SPtr sock, SPtr respondee) : SocketWriter(world.uri_map(), world.uris(), uri, sock) @@ -48,7 +48,7 @@ public: static SPtr new_socket_interface(Ingen::World* world, - const Raul::URI& uri, + const URI& uri, SPtr respondee) { const Raul::Socket::Type type = (uri.scheme() == "unix" diff --git a/ingen/client/ThreadedSigClientInterface.hpp b/ingen/client/ThreadedSigClientInterface.hpp index 6457d559..751ea37b 100644 --- a/ingen/client/ThreadedSigClientInterface.hpp +++ b/ingen/client/ThreadedSigClientInterface.hpp @@ -55,9 +55,7 @@ public: : message_slot(_signal_message.make_slot()) {} - Raul::URI uri() const override { - return Raul::URI("ingen:/clients/sig_queue"); - } + URI uri() const override { return URI("ingen:/clients/sig_queue"); } void message(const Message& msg) override { std::lock_guard lock(_mutex); @@ -87,7 +85,6 @@ private: using Graph = Resource::Graph; using Path = Raul::Path; - using URI = Raul::URI; sigc::slot message_slot; }; -- cgit v1.2.1