diff options
author | David Robillard <d@drobilla.net> | 2019-12-08 18:03:43 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-08 20:59:06 +0100 |
commit | c35cbf038d0992887b8d4bcf5d4ff83c323ec60c (patch) | |
tree | 02384c6a8671e866a54cbd9f6002a3dd145116b9 | |
parent | 8215246d12f49573f7ebcdc62ddae84185c22bfe (diff) | |
download | ingen-c35cbf038d0992887b8d4bcf5d4ff83c323ec60c.tar.gz ingen-c35cbf038d0992887b8d4bcf5d4ff83c323ec60c.tar.bz2 ingen-c35cbf038d0992887b8d4bcf5d4ff83c323ec60c.zip |
Cleanup: Avoid parameter copying overhead
73 files changed, 422 insertions, 415 deletions
diff --git a/ingen/EngineBase.hpp b/ingen/EngineBase.hpp index 7b3239f1..36742601 100644 --- a/ingen/EngineBase.hpp +++ b/ingen/EngineBase.hpp @@ -132,12 +132,12 @@ public: /** Register a client to receive updates about engine changes. */ - virtual void register_client(SPtr<Interface> client) = 0; + virtual void register_client(const SPtr<Interface>& client) = 0; /** Unregister a client. */ - virtual bool unregister_client(SPtr<Interface> client) = 0; + virtual bool unregister_client(const SPtr<Interface>& client) = 0; }; } // namespace ingen diff --git a/ingen/LV2Features.hpp b/ingen/LV2Features.hpp index e2ce600f..06811294 100644 --- a/ingen/LV2Features.hpp +++ b/ingen/LV2Features.hpp @@ -78,7 +78,7 @@ protected: LV2_Feature** _array; }; - void add_feature(SPtr<Feature> feature); + void add_feature(const SPtr<Feature>& feature); bool is_supported(const std::string& uri) const; SPtr<FeatureArray> lv2_features(World& world, Node* node) const; diff --git a/ingen/Parser.hpp b/ingen/Parser.hpp index 8d868a8c..45d087cd 100644 --- a/ingen/Parser.hpp +++ b/ingen/Parser.hpp @@ -77,21 +77,21 @@ public: * @return whether or not load was successful. */ virtual bool parse_file( - World& world, - Interface& target, - const FilePath& path, - boost::optional<Raul::Path> parent = boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol = boost::optional<Raul::Symbol>(), - boost::optional<Properties> data = boost::optional<Properties>()); + World& world, + Interface& target, + const FilePath& path, + const boost::optional<Raul::Path>& parent = boost::optional<Raul::Path>(), + const boost::optional<Raul::Symbol>& symbol = boost::optional<Raul::Symbol>(), + const boost::optional<Properties>& data = boost::optional<Properties>()); virtual boost::optional<URI> parse_string( - World& world, - Interface& target, - const std::string& str, - const URI& base_uri, - boost::optional<Raul::Path> parent = boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol = boost::optional<Raul::Symbol>(), - boost::optional<Properties> data = boost::optional<Properties>()); + World& world, + Interface& target, + const std::string& str, + const URI& base_uri, + const boost::optional<Raul::Path>& parent = boost::optional<Raul::Path>(), + const boost::optional<Raul::Symbol>& symbol = boost::optional<Raul::Symbol>(), + const boost::optional<Properties>& data = boost::optional<Properties>()); }; } // namespace ingen diff --git a/ingen/Serialiser.hpp b/ingen/Serialiser.hpp index 4980a36d..776b837e 100644 --- a/ingen/Serialiser.hpp +++ b/ingen/Serialiser.hpp @@ -46,8 +46,8 @@ public: virtual ~Serialiser(); /** Write a graph and all its contents as a complete bundle. */ - virtual void write_bundle(SPtr<const Node> graph, - const URI& uri); + virtual void write_bundle(const SPtr<const Node>& graph, + const URI& uri); /** Begin a serialization to a string. * @@ -76,15 +76,15 @@ public: * * @throw std::logic_error */ - virtual void serialise(SPtr<const Node> object, - Property::Graph context = Property::Graph::DEFAULT); + virtual void serialise(const SPtr<const Node>& object, + Property::Graph context = Property::Graph::DEFAULT); /** Serialize an arc. * * @throw std::logic_error */ - virtual void serialise_arc(const Sord::Node& parent, - SPtr<const Arc> arc); + virtual void serialise_arc(const Sord::Node& parent, + const SPtr<const Arc>& arc); /** Finish serialization. * diff --git a/ingen/Store.hpp b/ingen/Store.hpp index 3c92dcc4..1aa90936 100644 --- a/ingen/Store.hpp +++ b/ingen/Store.hpp @@ -54,7 +54,7 @@ public: iterator find_descendants_end(Store::iterator parent); const_iterator find_descendants_end(Store::const_iterator parent) const; - const_range children_range(SPtr<const Node> o) const; + const_range children_range(const SPtr<const Node>& o) const; /** Remove the object at `top` and all its children from the store. * diff --git a/ingen/TurtleWriter.hpp b/ingen/TurtleWriter.hpp index 2ee027ae..9c88be2e 100644 --- a/ingen/TurtleWriter.hpp +++ b/ingen/TurtleWriter.hpp @@ -41,7 +41,7 @@ class URIs; class INGEN_API TurtleWriter : public AtomWriter, public AtomSink { public: - TurtleWriter(URIMap& map, URIs& uris, const URI& uri); + TurtleWriter(URIMap& map, URIs& uris, URI uri); ~TurtleWriter() override; diff --git a/ingen/World.hpp b/ingen/World.hpp index c8d69c5b..a2906525 100644 --- a/ingen/World.hpp +++ b/ingen/World.hpp @@ -102,16 +102,16 @@ public: * @param respondee The Interface that will receive responses to commands * and broadcasts, if applicable. */ - virtual SPtr<Interface> new_interface(const URI& engine_uri, - SPtr<Interface> respondee); + virtual SPtr<Interface> new_interface(const URI& engine_uri, + const SPtr<Interface>& respondee); /** Run a script. */ virtual bool run(const std::string& mime_type, const std::string& filename); - virtual void set_engine(SPtr<EngineBase> e); - virtual void set_interface(SPtr<Interface> i); - virtual void set_store(SPtr<Store> s); + virtual void set_engine(const SPtr<EngineBase>& e); + virtual void set_interface(const SPtr<Interface>& i); + virtual void set_store(const SPtr<Store>& s); virtual SPtr<EngineBase> engine(); virtual SPtr<Interface> interface(); diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index f6aa731a..d1f754bd 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -64,18 +64,18 @@ public: uint32_t num_ports() const override { return _ports.size(); } const Ports& ports() const { return _ports; } - void default_port_value_range(SPtr<const PortModel> port, - float& min, - float& max, - uint32_t srate = 1) const; + void default_port_value_range(const SPtr<const PortModel>& port, + float& min, + float& max, + uint32_t srate = 1) const; - void port_value_range(SPtr<const PortModel> port, - float& min, - float& max, - uint32_t srate = 1) const; + void port_value_range(const SPtr<const PortModel>& port, + float& min, + float& max, + uint32_t srate = 1) const; std::string label() const; - std::string port_label(SPtr<const PortModel> port) const; + std::string port_label(const SPtr<const PortModel>& port) const; // Signals INGEN_SIGNAL(new_port, void, SPtr<const PortModel>); @@ -87,17 +87,19 @@ protected: BlockModel(URIs& uris, const URI& plugin_uri, const Raul::Path& path); - BlockModel(URIs& uris, - SPtr<PluginModel> plugin, - const Raul::Path& path); + + BlockModel(URIs& uris, + const SPtr<PluginModel>& plugin, + const Raul::Path& path); + explicit BlockModel(const Raul::Path& path); - void add_child(SPtr<ObjectModel> c) override; - bool remove_child(SPtr<ObjectModel> c) override; - void add_port(SPtr<PortModel> pm); - void remove_port(SPtr<PortModel> port); + void add_child(const SPtr<ObjectModel>& c) override; + bool remove_child(const SPtr<ObjectModel>& c) override; + void add_port(const SPtr<PortModel>& pm); + void remove_port(const SPtr<PortModel>& port); void remove_port(const Raul::Path& port_path); - void set(SPtr<ObjectModel> model) override; + void set(const SPtr<ObjectModel>& model) override; virtual void clear(); diff --git a/ingen/client/GraphModel.hpp b/ingen/client/GraphModel.hpp index 8713b6a9..c3339048 100644 --- a/ingen/client/GraphModel.hpp +++ b/ingen/client/GraphModel.hpp @@ -64,11 +64,11 @@ private: {} void clear() override; - void add_child(SPtr<ObjectModel> c) override; - bool remove_child(SPtr<ObjectModel> o) override; - void remove_arcs_on(SPtr<PortModel> p); + void add_child(const SPtr<ObjectModel>& c) override; + bool remove_child(const SPtr<ObjectModel>& o) override; + void remove_arcs_on(const SPtr<PortModel>& p); - void add_arc(SPtr<ArcModel> arc); + void add_arc(const SPtr<ArcModel>& arc); void remove_arc(const ingen::Node* tail, const ingen::Node* head); }; diff --git a/ingen/client/ObjectModel.hpp b/ingen/client/ObjectModel.hpp index 94906dec..535bcdd2 100644 --- a/ingen/client/ObjectModel.hpp +++ b/ingen/client/ObjectModel.hpp @@ -80,11 +80,11 @@ protected: ObjectModel(const ObjectModel& copy); void set_path(const Raul::Path& p) override; - virtual void set_parent(SPtr<ObjectModel> p); - virtual void add_child(SPtr<ObjectModel> c) {} - virtual bool remove_child(SPtr<ObjectModel> c) { return true; } + virtual void set_parent(const SPtr<ObjectModel>& p); + virtual void add_child(const SPtr<ObjectModel>& c) {} + virtual bool remove_child(const SPtr<ObjectModel>& c) { return true; } - virtual void set(SPtr<ObjectModel> o); + virtual void set(const SPtr<ObjectModel>& o); SPtr<ObjectModel> _parent; diff --git a/ingen/client/PortModel.hpp b/ingen/client/PortModel.hpp index 4aa033d1..8bdf0398 100644 --- a/ingen/client/PortModel.hpp +++ b/ingen/client/PortModel.hpp @@ -82,10 +82,10 @@ private: , _direction(dir) {} - void add_child(SPtr<ObjectModel> c) override { throw; } - bool remove_child(SPtr<ObjectModel> c) override { throw; } + void add_child(const SPtr<ObjectModel>& c) override { throw; } + bool remove_child(const SPtr<ObjectModel>& c) override { throw; } - void set(SPtr<ObjectModel> model) override; + void set(const SPtr<ObjectModel>& model) override; uint32_t _index; Direction _direction; diff --git a/src/LV2Features.cpp b/src/LV2Features.cpp index 048dc13f..6ae057f2 100644 --- a/src/LV2Features.cpp +++ b/src/LV2Features.cpp @@ -34,7 +34,7 @@ LV2Features::LV2Features() } void -LV2Features::add_feature(SPtr<Feature> feature) +LV2Features::add_feature(const SPtr<Feature>& feature) { _features.push_back(feature); } diff --git a/src/Parser.cpp b/src/Parser.cpp index e8599cf5..c1d8554d 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -86,7 +86,7 @@ Parser::find_resources(Sord::World& world, } static boost::optional<Raul::Path> -get_path(const URI base, const URI uri) +get_path(const URI& base, const URI& uri) { const URI relative = uri.make_relative(base); const std::string uri_str = "/" + relative.string(); @@ -104,11 +104,11 @@ skip_property(ingen::URIs& uris, const Sord::Node& predicate) } static Properties -get_properties(ingen::World& world, - Sord::Model& model, - const Sord::Node& subject, - Resource::Graph ctx, - boost::optional<Properties> data = {}) +get_properties(ingen::World& world, + Sord::Model& model, + const Sord::Node& subject, + Resource::Graph ctx, + const boost::optional<Properties>& data = {}) { AtomForge forge(world.uri_map().urid_map_feature()->urid_map); @@ -202,36 +202,36 @@ get_port(ingen::World& world, static boost::optional<Raul::Path> parse( - World& world, - Interface& target, - Sord::Model& model, - const URI& base_uri, - Sord::Node& subject, - boost::optional<Raul::Path> parent = boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol = boost::optional<Raul::Symbol>(), - boost::optional<Properties> data = boost::optional<Properties>()); + World& world, + Interface& target, + Sord::Model& model, + const URI& base_uri, + Sord::Node& subject, + const boost::optional<Raul::Path>& parent = boost::optional<Raul::Path>(), + const boost::optional<Raul::Symbol>& symbol = boost::optional<Raul::Symbol>(), + const boost::optional<Properties>& data = boost::optional<Properties>()); static boost::optional<Raul::Path> parse_graph( - World& world, - Interface& target, - Sord::Model& model, - const URI& base_uri, - const Sord::Node& subject, - Resource::Graph ctx, - boost::optional<Raul::Path> parent = boost::optional<Raul::Path>(), - boost::optional<Raul::Symbol> symbol = boost::optional<Raul::Symbol>(), - boost::optional<Properties> data = boost::optional<Properties>()); + World& world, + Interface& target, + Sord::Model& model, + const URI& base_uri, + const Sord::Node& subject, + Resource::Graph ctx, + const boost::optional<Raul::Path>& parent = boost::optional<Raul::Path>(), + const boost::optional<Raul::Symbol>& symbol = boost::optional<Raul::Symbol>(), + const boost::optional<Properties>& data = boost::optional<Properties>()); static boost::optional<Raul::Path> parse_block( - World& world, - Interface& target, - Sord::Model& model, - const URI& base_uri, - const Sord::Node& subject, - const Raul::Path& path, - boost::optional<Properties> data = boost::optional<Properties>()); + World& world, + Interface& target, + Sord::Model& model, + const URI& base_uri, + const Sord::Node& subject, + const Raul::Path& path, + const boost::optional<Properties>& data = boost::optional<Properties>()); static bool parse_arcs( @@ -243,13 +243,13 @@ parse_arcs( const Raul::Path& graph); static boost::optional<Raul::Path> -parse_block(ingen::World& world, - ingen::Interface& target, - Sord::Model& model, - const URI& base_uri, - const Sord::Node& subject, - const Raul::Path& path, - boost::optional<Properties> data) +parse_block(ingen::World& world, + ingen::Interface& target, + Sord::Model& model, + const URI& base_uri, + const Sord::Node& subject, + const Raul::Path& path, + const boost::optional<Properties>& data) { const URIs& uris = world.uris(); @@ -317,15 +317,15 @@ parse_block(ingen::World& world, } static boost::optional<Raul::Path> -parse_graph(ingen::World& world, - ingen::Interface& target, - Sord::Model& model, - const URI& base_uri, - const Sord::Node& subject, - Resource::Graph ctx, - boost::optional<Raul::Path> parent, - boost::optional<Raul::Symbol> symbol, - boost::optional<Properties> data) +parse_graph(ingen::World& world, + ingen::Interface& target, + Sord::Model& model, + const URI& base_uri, + const Sord::Node& subject, + Resource::Graph ctx, + const boost::optional<Raul::Path>& parent, + const boost::optional<Raul::Symbol>& symbol, + const boost::optional<Properties>& data) { const URIs& uris = world.uris(); @@ -345,10 +345,6 @@ parse_graph(ingen::World& world, graph_path = Raul::Path("/"); } - if (!symbol) { - symbol = Raul::Symbol("_"); - } - // Create graph Properties props = get_properties(world, model, subject, ctx, data); target.put(path_to_uri(graph_path), props, ctx); @@ -503,14 +499,14 @@ parse_arcs(ingen::World& world, } static boost::optional<Raul::Path> -parse(ingen::World& world, - ingen::Interface& target, - Sord::Model& model, - const URI& base_uri, - Sord::Node& subject, - boost::optional<Raul::Path> parent, - boost::optional<Raul::Symbol> symbol, - boost::optional<Properties> data) +parse(ingen::World& world, + ingen::Interface& target, + Sord::Model& model, + const URI& base_uri, + Sord::Node& subject, + const boost::optional<Raul::Path>& parent, + const boost::optional<Raul::Symbol>& symbol, + const boost::optional<Properties>& data) { const URIs& uris = world.uris(); @@ -582,12 +578,12 @@ parse(ingen::World& world, } bool -Parser::parse_file(ingen::World& world, - ingen::Interface& target, - const FilePath& path, - boost::optional<Raul::Path> parent, - boost::optional<Raul::Symbol> symbol, - boost::optional<Properties> data) +Parser::parse_file(ingen::World& world, + ingen::Interface& target, + const FilePath& path, + const boost::optional<Raul::Path>& parent, + const boost::optional<Raul::Symbol>& symbol, + const boost::optional<Properties>& data) { // Get absolute file path FilePath file_path = path; @@ -670,13 +666,13 @@ Parser::parse_file(ingen::World& world, } boost::optional<URI> -Parser::parse_string(ingen::World& world, - ingen::Interface& target, - const std::string& str, - const URI& base_uri, - boost::optional<Raul::Path> parent, - boost::optional<Raul::Symbol> symbol, - boost::optional<Properties> data) +Parser::parse_string(ingen::World& world, + ingen::Interface& target, + const std::string& str, + const URI& base_uri, + const boost::optional<Raul::Path>& parent, + const boost::optional<Raul::Symbol>& symbol, + const boost::optional<Properties>& data) { // Load string into model Sord::Model model(*world.rdf_world(), base_uri, SORD_SPO|SORD_PSO, false); diff --git a/src/Serialiser.cpp b/src/Serialiser.cpp index fede65c6..10f587f4 100644 --- a/src/Serialiser.cpp +++ b/src/Serialiser.cpp @@ -70,12 +70,12 @@ struct Serialiser::Impl { void start_to_file(const Raul::Path& root, const FilePath& filename); - std::set<const Resource*> serialise_graph(SPtr<const Node> graph, - const Sord::Node& graph_id); + std::set<const Resource*> serialise_graph(const SPtr<const Node>& graph, + const Sord::Node& graph_id); - void serialise_block(SPtr<const Node> block, - const Sord::Node& class_id, - const Sord::Node& block_id); + void serialise_block(const SPtr<const Node>& block, + const Sord::Node& class_id, + const Sord::Node& block_id); void serialise_port(const Node* port, Resource::Graph context, @@ -84,18 +84,18 @@ struct Serialiser::Impl { void serialise_properties(Sord::Node id, const Properties& props); - void write_bundle(SPtr<const Node> graph, const URI& uri); + void write_bundle(const SPtr<const Node>& graph, const URI& uri); Sord::Node path_rdf_node(const Raul::Path& path); - void write_manifest(const FilePath& bundle_path, - SPtr<const Node> graph); + void write_manifest(const FilePath& bundle_path, + const SPtr<const Node>& graph); - void write_plugins(const FilePath& bundle_path, - const std::set<const Resource*> plugins); + void write_plugins(const FilePath& bundle_path, + const std::set<const Resource*>& plugins); - void serialise_arc(const Sord::Node& parent, - SPtr<const Arc> arc); + void serialise_arc(const Sord::Node& parent, + const SPtr<const Arc>& arc); std::string finish(); @@ -116,8 +116,8 @@ Serialiser::~Serialiser() {} void -Serialiser::Impl::write_manifest(const FilePath& bundle_path, - SPtr<const Node> graph) +Serialiser::Impl::write_manifest(const FilePath& bundle_path, + const SPtr<const Node>&) { const FilePath manifest_path(bundle_path / "manifest.ttl"); const FilePath binary_path(ingen_module_path("lv2")); @@ -147,8 +147,8 @@ Serialiser::Impl::write_manifest(const FilePath& bundle_path, } void -Serialiser::Impl::write_plugins(const FilePath& bundle_path, - const std::set<const Resource*> plugins) +Serialiser::Impl::write_plugins(const FilePath& bundle_path, + const std::set<const Resource*>& plugins) { const FilePath plugins_path(bundle_path / "plugins.ttl"); @@ -179,13 +179,13 @@ Serialiser::Impl::write_plugins(const FilePath& bundle_path, } void -Serialiser::write_bundle(SPtr<const Node> graph, const URI& uri) +Serialiser::write_bundle(const SPtr<const Node>& graph, const URI& uri) { me->write_bundle(graph, uri); } void -Serialiser::Impl::write_bundle(SPtr<const Node> graph, const URI& uri) +Serialiser::Impl::write_bundle(const SPtr<const Node>& graph, const URI& uri) { FilePath path(uri.path()); if (filesystem::exists(path) && !filesystem::is_directory(path)) { @@ -283,7 +283,7 @@ Serialiser::Impl::path_rdf_node(const Raul::Path& path) } void -Serialiser::serialise(SPtr<const Node> object, Resource::Graph context) +Serialiser::serialise(const SPtr<const Node>& object, Resource::Graph context) { if (!me->_model) { throw std::logic_error("serialise called without serialisation in progress"); @@ -304,8 +304,8 @@ Serialiser::serialise(SPtr<const Node> object, Resource::Graph context) } std::set<const Resource*> -Serialiser::Impl::serialise_graph(SPtr<const Node> graph, - const Sord::Node& graph_id) +Serialiser::Impl::serialise_graph(const SPtr<const Node>& graph, + const Sord::Node& graph_id) { Sord::World& world = _model->world(); const URIs& uris = _world.uris(); @@ -416,9 +416,9 @@ Serialiser::Impl::serialise_graph(SPtr<const Node> graph, } void -Serialiser::Impl::serialise_block(SPtr<const Node> block, - const Sord::Node& class_id, - const Sord::Node& block_id) +Serialiser::Impl::serialise_block(const SPtr<const Node>& block, + const Sord::Node& class_id, + const Sord::Node& block_id) { const URIs& uris = _world.uris(); @@ -495,15 +495,15 @@ Serialiser::Impl::serialise_port(const Node* port, } void -Serialiser::serialise_arc(const Sord::Node& parent, - SPtr<const Arc> arc) +Serialiser::serialise_arc(const Sord::Node& parent, + const SPtr<const Arc>& arc) { return me->serialise_arc(parent, arc); } void -Serialiser::Impl::serialise_arc(const Sord::Node& parent, - SPtr<const Arc> arc) +Serialiser::Impl::serialise_arc(const Sord::Node& parent, + const SPtr<const Arc>& arc) { if (!_model) { throw std::logic_error( diff --git a/src/Store.cpp b/src/Store.cpp index 5d729a02..2373e871 100644 --- a/src/Store.cpp +++ b/src/Store.cpp @@ -77,7 +77,7 @@ Store::find_descendants_end(const const_iterator parent) const } Store::const_range -Store::children_range(SPtr<const Node> o) const +Store::children_range(const SPtr<const Node>& o) const { const const_iterator parent = find(o->path()); if (parent != end()) { diff --git a/src/TurtleWriter.cpp b/src/TurtleWriter.cpp index c1878791..85777044 100644 --- a/src/TurtleWriter.cpp +++ b/src/TurtleWriter.cpp @@ -37,11 +37,11 @@ write_prefix(void* handle, const SerdNode* name, const SerdNode* uri) return SERD_SUCCESS; } -TurtleWriter::TurtleWriter(URIMap& map, URIs& uris, const URI& uri) +TurtleWriter::TurtleWriter(URIMap& map, URIs& uris, URI uri) : AtomWriter(map, uris, *this) , _map(map) , _sratom(sratom_new(&map.urid_map_feature()->urid_map)) - , _uri(uri) + , _uri(std::move(uri)) , _wrote_prefixes(false) { // Use <ingen:/> as base URI, so relative URIs are like bundle paths diff --git a/src/World.cpp b/src/World.cpp index 1ba72259..8dbc0518 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -224,9 +224,9 @@ World::load_configuration(int& argc, char**& argv) _impl->log.set_trace(_impl->conf.option("trace").get<int32_t>()); } -void World::set_engine(SPtr<EngineBase> e) { _impl->engine = e; } -void World::set_interface(SPtr<Interface> i) { _impl->interface = i; } -void World::set_store(SPtr<Store> s) { _impl->store = s; } +void World::set_engine(const SPtr<EngineBase>& e) { _impl->engine = e; } +void World::set_interface(const SPtr<Interface>& i) { _impl->interface = i; } +void World::set_store(const SPtr<Store>& s) { _impl->store = s; } SPtr<EngineBase> World::engine() { return _impl->engine; } SPtr<Interface> World::interface() { return _impl->interface; } @@ -292,7 +292,7 @@ World::run_module(const char* name) /** Get an interface for a remote engine at `engine_uri` */ SPtr<Interface> -World::new_interface(const URI& engine_uri, SPtr<Interface> respondee) +World::new_interface(const URI& engine_uri, const SPtr<Interface>& respondee) { const Impl::InterfaceFactories::const_iterator i = _impl->interface_factories.find(std::string(engine_uri.scheme())); diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index 4cee9ac0..f9eaa26e 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -29,9 +29,9 @@ namespace ingen { namespace client { -BlockModel::BlockModel(URIs& uris, - SPtr<PluginModel> plugin, - const Raul::Path& path) +BlockModel::BlockModel(URIs& uris, + const SPtr<PluginModel>& plugin, + const Raul::Path& path) : ObjectModel(uris, path) , _plugin_uri(plugin->uri()) , _plugin(plugin) @@ -69,7 +69,7 @@ BlockModel::~BlockModel() } void -BlockModel::remove_port(SPtr<PortModel> port) +BlockModel::remove_port(const SPtr<PortModel>& port) { for (auto i = _ports.begin(); i != _ports.end(); ++i) { if ((*i) == port) { @@ -103,7 +103,7 @@ BlockModel::clear() } void -BlockModel::add_child(SPtr<ObjectModel> c) +BlockModel::add_child(const SPtr<ObjectModel>& c) { assert(c->parent().get() == this); @@ -115,7 +115,7 @@ BlockModel::add_child(SPtr<ObjectModel> c) } bool -BlockModel::remove_child(SPtr<ObjectModel> c) +BlockModel::remove_child(const SPtr<ObjectModel>& c) { assert(c->path().is_child_of(path())); assert(c->parent().get() == this); @@ -131,7 +131,7 @@ BlockModel::remove_child(SPtr<ObjectModel> c) } void -BlockModel::add_port(SPtr<PortModel> pm) +BlockModel::add_port(const SPtr<PortModel>& pm) { assert(pm); assert(pm->path().is_child_of(path())); @@ -170,10 +170,10 @@ BlockModel::port(uint32_t index) const } void -BlockModel::default_port_value_range(SPtr<const PortModel> port, - float& min, - float& max, - uint32_t srate) const +BlockModel::default_port_value_range(const SPtr<const PortModel>& port, + float& min, + float& max, + uint32_t srate) const { // Default control values min = 0.0; @@ -204,10 +204,10 @@ BlockModel::default_port_value_range(SPtr<const PortModel> port, } void -BlockModel::port_value_range(SPtr<const PortModel> port, - float& min, - float& max, - uint32_t srate) const +BlockModel::port_value_range(const SPtr<const PortModel>& port, + float& min, + float& max, + uint32_t srate) const { assert(port->parent().get() == this); @@ -247,7 +247,7 @@ BlockModel::label() const } std::string -BlockModel::port_label(SPtr<const PortModel> port) const +BlockModel::port_label(const SPtr<const PortModel>& port) const { const Atom& name = port->get_property(URI(LV2_CORE__name)); if (name.is_valid() && name.type() == _uris.forge.String) { @@ -274,7 +274,7 @@ BlockModel::port_label(SPtr<const PortModel> port) const } void -BlockModel::set(SPtr<ObjectModel> model) +BlockModel::set(const SPtr<ObjectModel>& model) { SPtr<BlockModel> block = dynamic_ptr_cast<BlockModel>(model); if (block) { diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp index 8999ace8..90ab2964 100644 --- a/src/client/GraphModel.cpp +++ b/src/client/GraphModel.cpp @@ -29,7 +29,7 @@ namespace ingen { namespace client { void -GraphModel::add_child(SPtr<ObjectModel> c) +GraphModel::add_child(const SPtr<ObjectModel>& c) { assert(c->parent().get() == this); @@ -46,7 +46,7 @@ GraphModel::add_child(SPtr<ObjectModel> c) } bool -GraphModel::remove_child(SPtr<ObjectModel> o) +GraphModel::remove_child(const SPtr<ObjectModel>& o) { assert(o->path().is_child_of(path())); assert(o->parent().get() == this); @@ -66,7 +66,7 @@ GraphModel::remove_child(SPtr<ObjectModel> o) } void -GraphModel::remove_arcs_on(SPtr<PortModel> p) +GraphModel::remove_arcs_on(const SPtr<PortModel>& p) { // Remove any connections which referred to this object, // since they can't possibly exist anymore @@ -116,7 +116,7 @@ GraphModel::get_arc(const Node* tail, const Node* head) * this graph is a fatal error. */ void -GraphModel::add_arc(SPtr<ArcModel> arc) +GraphModel::add_arc(const SPtr<ArcModel>& arc) { // Store should have 'resolved' the connection already assert(arc); diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index ff7ab88b..b1a27590 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -81,7 +81,7 @@ ObjectModel::polyphonic() const * `o` as correct. The paths of the two models MUST be equal. */ void -ObjectModel::set(SPtr<ObjectModel> o) +ObjectModel::set(const SPtr<ObjectModel>& o) { assert(_path == o->path()); if (o->_parent) { @@ -104,7 +104,7 @@ ObjectModel::set_path(const Raul::Path& p) } void -ObjectModel::set_parent(SPtr<ObjectModel> p) +ObjectModel::set_parent(const SPtr<ObjectModel>& p) { assert(_path.is_child_of(p->path())); _parent = p; diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 79a3527a..6b2d011f 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -65,7 +65,7 @@ PortModel::is_uri() const } void -PortModel::set(SPtr<ObjectModel> model) +PortModel::set(const SPtr<ObjectModel>& model) { ObjectModel::set(model); diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index 0c33072f..13b17bdf 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -307,7 +307,7 @@ GraphCanvas::show_port_names(bool b) } void -GraphCanvas::add_plugin(SPtr<PluginModel> p) +GraphCanvas::add_plugin(const SPtr<PluginModel>& p) { if (_internal_menu && _app.uris().ingen_Internal == p->type()) { _internal_menu->items().push_back( @@ -327,7 +327,7 @@ GraphCanvas::remove_plugin(const URI& uri) } void -GraphCanvas::add_block(SPtr<const BlockModel> bm) +GraphCanvas::add_block(const SPtr<const BlockModel>& bm) { SPtr<const GraphModel> pm = dynamic_ptr_cast<const GraphModel>(bm); NodeModule* module; @@ -345,7 +345,7 @@ GraphCanvas::add_block(SPtr<const BlockModel> bm) } void -GraphCanvas::remove_block(SPtr<const BlockModel> bm) +GraphCanvas::remove_block(const SPtr<const BlockModel>& bm) { auto i = _views.find(bm); @@ -360,7 +360,7 @@ GraphCanvas::remove_block(SPtr<const BlockModel> bm) } void -GraphCanvas::add_port(SPtr<const PortModel> pm) +GraphCanvas::add_port(const SPtr<const PortModel>& pm) { GraphPortModule* view = GraphPortModule::create(*this, pm); _views.emplace(pm, view); @@ -368,7 +368,7 @@ GraphCanvas::add_port(SPtr<const PortModel> pm) } void -GraphCanvas::remove_port(SPtr<const PortModel> pm) +GraphCanvas::remove_port(const SPtr<const PortModel>& pm) { auto i = _views.find(pm); @@ -386,7 +386,7 @@ GraphCanvas::remove_port(SPtr<const PortModel> pm) } Ganv::Port* -GraphCanvas::get_port_view(SPtr<PortModel> port) +GraphCanvas::get_port_view(const SPtr<PortModel>& port) { Ganv::Module* module = _views[port]; @@ -413,7 +413,7 @@ GraphCanvas::get_port_view(SPtr<PortModel> port) /** Called when a connection is added to the model. */ void -GraphCanvas::connection(SPtr<const ArcModel> arc) +GraphCanvas::connection(const SPtr<const ArcModel>& arc) { Ganv::Port* const tail = get_port_view(arc->tail()); Ganv::Port* const head = get_port_view(arc->head()); @@ -428,7 +428,7 @@ GraphCanvas::connection(SPtr<const ArcModel> arc) /** Called when a connection is removed from the model. */ void -GraphCanvas::disconnection(SPtr<const ArcModel> arc) +GraphCanvas::disconnection(const SPtr<const ArcModel>& arc) { Ganv::Port* const tail = get_port_view(arc->tail()); Ganv::Port* const head = get_port_view(arc->head()); diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp index 9047a373..7aa4bb98 100644 --- a/src/gui/GraphCanvas.hpp +++ b/src/gui/GraphCanvas.hpp @@ -61,14 +61,14 @@ public: void show_port_names(bool b); bool show_port_names() const { return _show_port_names; } - void add_plugin(SPtr<client::PluginModel> p); + void add_plugin(const SPtr<client::PluginModel>& p); void remove_plugin(const URI& uri); - void add_block(SPtr<const client::BlockModel> bm); - void remove_block(SPtr<const client::BlockModel> bm); - void add_port(SPtr<const client::PortModel> pm); - void remove_port(SPtr<const client::PortModel> pm); - void connection(SPtr<const client::ArcModel> arc); - void disconnection(SPtr<const client::ArcModel> arc); + void add_block(const SPtr<const client::BlockModel>& bm); + void remove_block(const SPtr<const client::BlockModel>& bm); + void add_port(const SPtr<const client::PortModel>& pm); + void remove_port(const SPtr<const client::PortModel>& pm); + void connection(const SPtr<const client::ArcModel>& arc); + void disconnection(const SPtr<const client::ArcModel>& arc); void get_new_module_location(double& x, double& y); @@ -106,7 +106,7 @@ private: Properties get_initial_data(Resource::Graph ctx=Resource::Graph::DEFAULT); - Ganv::Port* get_port_view(SPtr<client::PortModel> port); + Ganv::Port* get_port_view(const SPtr<client::PortModel>& port); void connect(Ganv::Node* tail, Ganv::Node* head); diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp index ffca1834..1947f355 100644 --- a/src/gui/GraphPortModule.cpp +++ b/src/gui/GraphPortModule.cpp @@ -40,8 +40,8 @@ using namespace client; namespace gui { -GraphPortModule::GraphPortModule(GraphCanvas& canvas, - SPtr<const client::PortModel> model) +GraphPortModule::GraphPortModule(GraphCanvas& canvas, + const SPtr<const client::PortModel>& model) : Ganv::Module(canvas, "", 0, 0, false) // FIXME: coords? , _model(model) , _port(nullptr) @@ -63,8 +63,7 @@ GraphPortModule::GraphPortModule(GraphCanvas& canvas, } GraphPortModule* -GraphPortModule::create(GraphCanvas& canvas, - SPtr<const PortModel> model) +GraphPortModule::create(GraphCanvas& canvas, const SPtr<const PortModel>& model) { GraphPortModule* ret = new GraphPortModule(canvas, model); Port* port = Port::create(canvas.app(), *ret, model, true); diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp index 6400b327..cad3bfc5 100644 --- a/src/gui/GraphPortModule.hpp +++ b/src/gui/GraphPortModule.hpp @@ -45,9 +45,8 @@ class PortMenu; class GraphPortModule : public Ganv::Module { public: - static GraphPortModule* create( - GraphCanvas& canvas, - SPtr<const client::PortModel> model); + static GraphPortModule* + create(GraphCanvas& canvas, const SPtr<const client::PortModel>& model); App& app() const; @@ -59,8 +58,8 @@ public: SPtr<const client::PortModel> port() const { return _model; } protected: - GraphPortModule(GraphCanvas& canvas, - SPtr<const client::PortModel> model); + GraphPortModule(GraphCanvas& canvas, + const SPtr<const client::PortModel>& model); bool show_menu(GdkEventButton* ev); void set_selected(gboolean b) override; diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp index 7d00b0f5..5046eac9 100644 --- a/src/gui/GraphTreeWindow.cpp +++ b/src/gui/GraphTreeWindow.cpp @@ -73,7 +73,7 @@ GraphTreeWindow::init(App& app, ClientStore& store) } void -GraphTreeWindow::new_object(SPtr<ObjectModel> object) +GraphTreeWindow::new_object(const SPtr<ObjectModel>& object) { SPtr<GraphModel> graph = dynamic_ptr_cast<GraphModel>(object); if (graph) { @@ -82,7 +82,7 @@ GraphTreeWindow::new_object(SPtr<ObjectModel> object) } void -GraphTreeWindow::add_graph(SPtr<GraphModel> pm) +GraphTreeWindow::add_graph(const SPtr<GraphModel>& pm) { if (!pm->parent()) { Gtk::TreeModel::iterator iter = _graph_treestore->append(); @@ -123,7 +123,7 @@ GraphTreeWindow::add_graph(SPtr<GraphModel> pm) } void -GraphTreeWindow::remove_graph(SPtr<GraphModel> pm) +GraphTreeWindow::remove_graph(const SPtr<GraphModel>& pm) { Gtk::TreeModel::iterator i = find_graph(_graph_treestore->children(), pm); if (i != _graph_treestore->children().end()) { @@ -132,8 +132,8 @@ GraphTreeWindow::remove_graph(SPtr<GraphModel> pm) } Gtk::TreeModel::iterator -GraphTreeWindow::find_graph(Gtk::TreeModel::Children root, - SPtr<client::ObjectModel> graph) +GraphTreeWindow::find_graph(Gtk::TreeModel::Children root, + const SPtr<client::ObjectModel>& graph) { for (Gtk::TreeModel::iterator c = root.begin(); c != root.end(); ++c) { SPtr<GraphModel> pm = (*c)[_graph_tree_columns.graph_model_col]; @@ -193,9 +193,9 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str) } void -GraphTreeWindow::graph_property_changed(const URI& key, - const Atom& value, - SPtr<GraphModel> graph) +GraphTreeWindow::graph_property_changed(const URI& key, + const Atom& value, + const SPtr<GraphModel>& graph) { const URIs& uris = _app->uris(); _enable_signal = false; @@ -212,7 +212,7 @@ GraphTreeWindow::graph_property_changed(const URI& key, } void -GraphTreeWindow::graph_moved(SPtr<GraphModel> graph) +GraphTreeWindow::graph_moved(const SPtr<GraphModel>& graph) { _enable_signal = false; diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp index eb5a5f78..c1ea53c2 100644 --- a/src/gui/GraphTreeWindow.hpp +++ b/src/gui/GraphTreeWindow.hpp @@ -47,16 +47,16 @@ public: void init(App& app, client::ClientStore& store); - void new_object(SPtr<client::ObjectModel> object); + void new_object(const SPtr<client::ObjectModel>& object); - void graph_property_changed(const URI& key, - const Atom& value, - SPtr<client::GraphModel> graph); + void graph_property_changed(const URI& key, + const Atom& value, + const SPtr<client::GraphModel>& graph); - void graph_moved(SPtr<client::GraphModel> graph); + void graph_moved(const SPtr<client::GraphModel>& graph); - void add_graph(SPtr<client::GraphModel> pm); - void remove_graph(SPtr<client::GraphModel> pm); + void add_graph(const SPtr<client::GraphModel>& pm); + void remove_graph(const SPtr<client::GraphModel>& pm); void show_graph_menu(GdkEventButton* ev); protected: @@ -67,7 +67,7 @@ protected: Gtk::TreeModel::iterator find_graph( Gtk::TreeModel::Children root, - SPtr<client::ObjectModel> graph); + const SPtr<client::ObjectModel>& graph); GraphTreeView* _graphs_treeview; diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp index 9e39ef7c..36c6caed 100644 --- a/src/gui/GraphView.cpp +++ b/src/gui/GraphView.cpp @@ -66,7 +66,7 @@ GraphView::init(App& app) } void -GraphView::set_graph(SPtr<const GraphModel> graph) +GraphView::set_graph(const SPtr<const GraphModel>& graph) { assert(!_canvas); // FIXME: remove @@ -101,7 +101,7 @@ GraphView::set_graph(SPtr<const GraphModel> graph) } SPtr<GraphView> -GraphView::create(App& app, SPtr<const GraphModel> graph) +GraphView::create(App& app, const SPtr<const GraphModel>& graph) { GraphView* result = nullptr; Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win"); diff --git a/src/gui/GraphView.hpp b/src/gui/GraphView.hpp index 8c62ba3d..457a5f76 100644 --- a/src/gui/GraphView.hpp +++ b/src/gui/GraphView.hpp @@ -69,11 +69,11 @@ public: SPtr<const client::GraphModel> graph() const { return _graph; } Gtk::ToolItem* breadcrumb_container() const { return _breadcrumb_container; } - static SPtr<GraphView> create(App& app, - SPtr<const client::GraphModel> graph); + static SPtr<GraphView> + create(App& app, const SPtr<const client::GraphModel>& graph); private: - void set_graph(SPtr<const client::GraphModel> graph); + void set_graph(const SPtr<const client::GraphModel>& graph); void process_toggled(); void poly_changed(); diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp index fb1dc9ff..e3588ddf 100644 --- a/src/gui/LoadGraphWindow.cpp +++ b/src/gui/LoadGraphWindow.cpp @@ -97,9 +97,9 @@ LoadGraphWindow::LoadGraphWindow(BaseObjectType* cobject, } void -LoadGraphWindow::present(SPtr<const GraphModel> graph, - bool import, - Properties data) +LoadGraphWindow::present(const SPtr<const GraphModel>& graph, + bool import, + const Properties& data) { _import = import; set_graph(graph); @@ -117,7 +117,7 @@ LoadGraphWindow::present(SPtr<const GraphModel> graph, * This function MUST be called before using the window in any way! */ void -LoadGraphWindow::set_graph(SPtr<const GraphModel> graph) +LoadGraphWindow::set_graph(const SPtr<const GraphModel>& graph) { _graph = graph; _symbol_entry->set_text(""); diff --git a/src/gui/LoadGraphWindow.hpp b/src/gui/LoadGraphWindow.hpp index 32d435ad..a2217d83 100644 --- a/src/gui/LoadGraphWindow.hpp +++ b/src/gui/LoadGraphWindow.hpp @@ -50,11 +50,11 @@ public: void init(App& app) { _app = &app; } - void set_graph(SPtr<const client::GraphModel> graph); + void set_graph(const SPtr<const client::GraphModel>& graph); - void present(SPtr<const client::GraphModel> graph, - bool import, - Properties data); + void present(const SPtr<const client::GraphModel>& graph, + bool import, + const Properties& data); protected: void on_show() override; diff --git a/src/server/BlockImpl.cpp b/src/server/BlockImpl.cpp index 263e6fce..abea85eb 100644 --- a/src/server/BlockImpl.cpp +++ b/src/server/BlockImpl.cpp @@ -294,10 +294,10 @@ BlockImpl::post_process(RunContext& context) } void -BlockImpl::set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf, - SampleCount offset) +BlockImpl::set_port_buffer(uint32_t voice, + uint32_t port_num, + const BufferRef& buf, + SampleCount offset) { /*std::cout << path() << " set port " << port_num << " voice " << voice << " buffer " << buf << " offset " << offset << std::endl;*/ diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index c8c36ddf..15a4e075 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -133,10 +133,10 @@ public: virtual void post_process(RunContext& context); /** Set the buffer of a port to a given buffer (e.g. connect plugin to buffer) */ - virtual void set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf, - SampleCount offset); + virtual void set_port_buffer(uint32_t voice, + uint32_t port_num, + const BufferRef& buf, + SampleCount offset); Node* port(uint32_t index) const override; virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } diff --git a/src/server/Broadcaster.cpp b/src/server/Broadcaster.cpp index c3fb82ef..914b891b 100644 --- a/src/server/Broadcaster.cpp +++ b/src/server/Broadcaster.cpp @@ -42,7 +42,7 @@ Broadcaster::~Broadcaster() /** Register a client to receive messages over the notification band. */ void -Broadcaster::register_client(SPtr<Interface> client) +Broadcaster::register_client(const SPtr<Interface>& client) { std::lock_guard<std::mutex> lock(_clients_mutex); _clients.insert(client); @@ -53,7 +53,7 @@ Broadcaster::register_client(SPtr<Interface> client) * @return true if client was found and removed. */ bool -Broadcaster::unregister_client(SPtr<Interface> client) +Broadcaster::unregister_client(const SPtr<Interface>& client) { std::lock_guard<std::mutex> lock(_clients_mutex); const size_t erased = _clients.erase(client); @@ -62,7 +62,7 @@ Broadcaster::unregister_client(SPtr<Interface> client) } void -Broadcaster::set_broadcast(SPtr<Interface> client, bool broadcast) +Broadcaster::set_broadcast(const SPtr<Interface>& client, bool broadcast) { if (broadcast) { _broadcastees.insert(client); diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index a2d75284..bf586c38 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -45,18 +45,22 @@ public: Broadcaster(); ~Broadcaster(); - void register_client(SPtr<Interface> client); - bool unregister_client(SPtr<Interface> client); + void register_client(const SPtr<Interface>& client); + bool unregister_client(const SPtr<Interface>& client); - void set_broadcast(SPtr<Interface> client, bool broadcast); + void set_broadcast(const SPtr<Interface>& client, bool broadcast); /** Ignore a client when broadcasting. * * This is used to prevent feeding back updates to the client that * initiated a property set in the first place. */ - void set_ignore_client(SPtr<Interface> client) { _ignore_client = client; } - void clear_ignore_client() { _ignore_client.reset(); } + void set_ignore_client(const SPtr<Interface>& client) + { + _ignore_client = client; + } + + void clear_ignore_client() { _ignore_client.reset(); } /** Return true iff there are any clients with broadcasting enabled. * diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 18feff1f..545ce72b 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -336,7 +336,7 @@ Engine::main_iteration() } void -Engine::set_driver(SPtr<Driver> driver) +Engine::set_driver(const SPtr<Driver>& driver) { _driver = driver; for (const auto& ctx : _run_contexts) { @@ -510,14 +510,14 @@ Engine::log() const } void -Engine::register_client(SPtr<Interface> client) +Engine::register_client(const SPtr<Interface>& client) { log().info("Registering client <%1%>\n", client->uri().c_str()); _broadcaster->register_client(client); } bool -Engine::unregister_client(SPtr<Interface> client) +Engine::unregister_client(const SPtr<Interface>& client) { log().info("Unregistering client <%1%>\n", client->uri().c_str()); return _broadcaster->unregister_client(client); diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index d1f2da3d..55099f45 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -93,15 +93,15 @@ public: unsigned run(uint32_t sample_count) override; void quit() override; bool main_iteration() override; - void register_client(SPtr<Interface> client) override; - bool unregister_client(SPtr<Interface> client) override; + void register_client(const SPtr<Interface>& client) override; + bool unregister_client(const SPtr<Interface>& client) override; void listen() override; /** Return a random [0..1] float with uniform distribution */ float frand() { return _uniform_dist(_rand_engine); } - void set_driver(SPtr<Driver> driver); + void set_driver(const SPtr<Driver>& driver); /** Return the frame time to execute an event that arrived now. * diff --git a/src/server/Event.hpp b/src/server/Event.hpp index 1bd61187..7da4b955 100644 --- a/src/server/Event.hpp +++ b/src/server/Event.hpp @@ -104,7 +104,10 @@ public: inline Engine& engine() { return _engine; } protected: - Event(Engine& engine, SPtr<Interface> client, int32_t id, FrameTime time) + Event(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + FrameTime time) : _engine(engine) , _next(nullptr) , _request_client(std::move(client)) diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp index c00819c2..db1b4561 100644 --- a/src/server/GraphImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -271,7 +271,7 @@ GraphImpl::remove_block(BlockImpl& block) } void -GraphImpl::add_arc(SPtr<ArcImpl> a) +GraphImpl::add_arc(const SPtr<ArcImpl>& a) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); _arcs.emplace(std::make_pair(a->tail(), a->head()), a); diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index 846996f3..a03d3faa 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -156,7 +156,7 @@ public: /** Add an arc to this graph. * Pre-processing thread only. */ - void add_arc(SPtr<ArcImpl> a); + void add_arc(const SPtr<ArcImpl>& a); /** Remove an arc from this graph. * Pre-processing thread only. diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index aa9339d1..d7406bb5 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -732,10 +732,10 @@ LV2Block::save_preset(const URI& uri, } void -LV2Block::set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf, - SampleCount offset) +LV2Block::set_port_buffer(uint32_t voice, + uint32_t port_num, + const BufferRef& buf, + SampleCount offset) { BlockImpl::set_port_buffer(voice, port_num, buf, offset); lilv_instance_connect_port( diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp index 07c04321..8046189e 100644 --- a/src/server/LV2Block.hpp +++ b/src/server/LV2Block.hpp @@ -85,10 +85,10 @@ public: boost::optional<Resource> save_preset(const URI& uri, const Properties& props) override; - void set_port_buffer(uint32_t voice, - uint32_t port_num, - BufferRef buf, - SampleCount offset) override; + void set_port_buffer(uint32_t voice, + uint32_t port_num, + const BufferRef& buf, + SampleCount offset) override; static LilvState* load_state(World& world, const FilePath& path); diff --git a/src/server/Task.cpp b/src/server/Task.cpp index 0d76a43f..48da6040 100644 --- a/src/server/Task.cpp +++ b/src/server/Task.cpp @@ -140,7 +140,9 @@ Task::simplify(std::unique_ptr<Task>&& task) } void -Task::dump(std::function<void (const std::string&)> sink, unsigned indent, bool first) const +Task::dump(const std::function<void(const std::string&)>& sink, + unsigned indent, + bool first) const { if (!first) { sink("\n"); diff --git a/src/server/Task.hpp b/src/server/Task.hpp index a6489e61..e8b658c3 100644 --- a/src/server/Task.hpp +++ b/src/server/Task.hpp @@ -73,7 +73,9 @@ public: void run(RunContext& context); /** Pretty print task to the given stream (recursively). */ - void dump(std::function<void (const std::string&)> sink, unsigned indent, bool first) const; + void dump(const std::function<void(const std::string&)>& sink, + unsigned indent, + bool first) const; /** Return true iff this is an empty task. */ bool empty() const { return _mode != Mode::SINGLE && _children.empty(); } diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index d27e1e3b..23a7d4b4 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -38,10 +38,10 @@ namespace ingen { namespace server { namespace events { -Connect::Connect(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Connect& msg) +Connect::Connect(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Connect& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) , _graph(nullptr) diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index 625fa39d..adc80afc 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -38,10 +38,10 @@ namespace events { class Connect : public Event { public: - Connect(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Connect& msg); + Connect(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Connect& msg); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp index 38cbc6d8..a8e08924 100644 --- a/src/server/events/Copy.cpp +++ b/src/server/events/Copy.cpp @@ -36,10 +36,10 @@ namespace ingen { namespace server { namespace events { -Copy::Copy(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Copy& msg) +Copy::Copy(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Copy& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) , _old_block(nullptr) diff --git a/src/server/events/Copy.hpp b/src/server/events/Copy.hpp index 86a95e9c..26673a55 100644 --- a/src/server/events/Copy.hpp +++ b/src/server/events/Copy.hpp @@ -35,10 +35,10 @@ namespace events { class Copy : public Event { public: - Copy(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Copy& msg); + Copy(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Copy& msg); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index cfeb0e3d..e8816954 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -38,12 +38,12 @@ namespace ingen { namespace server { namespace events { -CreateBlock::CreateBlock(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - Properties& properties) +CreateBlock::CreateBlock(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index bf34f6e2..00f58008 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -38,12 +38,12 @@ namespace events { class CreateBlock : public Event { public: - CreateBlock(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - Properties& properties); + CreateBlock(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + Properties& properties); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index 5561d147..3e847bdd 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -35,12 +35,12 @@ namespace ingen { namespace server { namespace events { -CreateGraph::CreateGraph(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Properties& properties) +CreateGraph::CreateGraph(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) diff --git a/src/server/events/CreateGraph.hpp b/src/server/events/CreateGraph.hpp index 6ea07957..dadb644e 100644 --- a/src/server/events/CreateGraph.hpp +++ b/src/server/events/CreateGraph.hpp @@ -40,12 +40,12 @@ namespace events { class CreateGraph : public Event { public: - CreateGraph(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Properties& properties); + CreateGraph(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 09eb8cff..d1b4f114 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -40,12 +40,12 @@ namespace ingen { namespace server { namespace events { -CreatePort::CreatePort(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Properties& properties) +CreatePort::CreatePort(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties) : Event(engine, client, id, timestamp) , _path(path) , _port_type(PortType::UNKNOWN) diff --git a/src/server/events/CreatePort.hpp b/src/server/events/CreatePort.hpp index 9c5bb396..8137328d 100644 --- a/src/server/events/CreatePort.hpp +++ b/src/server/events/CreatePort.hpp @@ -44,12 +44,12 @@ namespace events { class CreatePort : public Event { public: - CreatePort(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - const Raul::Path& path, - const Properties& properties); + CreatePort(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + const Raul::Path& path, + const Properties& properties); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index 0b46f3f4..5d605bca 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -43,10 +43,10 @@ namespace ingen { namespace server { namespace events { -Delete::Delete(Engine& engine, - SPtr<Interface> client, - FrameTime timestamp, - const ingen::Del& msg) +Delete::Delete(Engine& engine, + const SPtr<Interface>& client, + FrameTime timestamp, + const ingen::Del& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) , _engine_port(nullptr) diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index 14acac83..6b3149e9 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -45,10 +45,10 @@ class DisconnectAll; class Delete : public Event { public: - Delete(Engine& engine, - SPtr<Interface> client, - FrameTime timestamp, - const ingen::Del& msg); + Delete(Engine& engine, + const SPtr<Interface>& client, + FrameTime timestamp, + const ingen::Del& msg); ~Delete(); diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index f5928c12..19e5bb20 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -48,10 +48,10 @@ class PreProcessContext; namespace events { -Delta::Delta(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Put& msg) +Delta::Delta(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Put& msg) : Event(engine, client, msg.seq, timestamp) , _create_event(nullptr) , _subject(msg.uri) @@ -67,10 +67,10 @@ Delta::Delta(Engine& engine, init(); } -Delta::Delta(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Delta& msg) +Delta::Delta(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Delta& msg) : Event(engine, client, msg.seq, timestamp) , _create_event(nullptr) , _subject(msg.uri) @@ -88,7 +88,7 @@ Delta::Delta(Engine& engine, } Delta::Delta(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::SetProperty& msg) : Event(engine, client, msg.seq, timestamp) diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index 4328ad83..2aa2ff90 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -47,18 +47,18 @@ class SetPortValue; class Delta : public Event { public: - Delta(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Put& msg); + Delta(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Put& msg); - Delta(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Delta& msg); + Delta(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Delta& msg); Delta(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::SetProperty& msg); diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index 349fb6ae..531d70af 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -44,7 +44,7 @@ namespace server { namespace events { Disconnect::Disconnect(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::Disconnect& msg) : Event(engine, client, msg.seq, timestamp) diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index 15872ba5..ec638c73 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -38,7 +38,7 @@ class Disconnect : public Event { public: Disconnect(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::Disconnect& msg); diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 9c949480..ada51302 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -41,7 +41,7 @@ namespace server { namespace events { DisconnectAll::DisconnectAll(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::DisconnectAll& msg) : Event(engine, client, msg.seq, timestamp) diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index 3edfedd6..9ab908c1 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -44,7 +44,7 @@ class DisconnectAll : public Event { public: DisconnectAll(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::DisconnectAll& msg); diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index 167f5f91..7bb6fd2f 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -37,10 +37,10 @@ namespace ingen { namespace server { namespace events { -Get::Get(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Get& msg) +Get::Get(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Get& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) , _object(nullptr) diff --git a/src/server/events/Get.hpp b/src/server/events/Get.hpp index b23c7294..e24c9998 100644 --- a/src/server/events/Get.hpp +++ b/src/server/events/Get.hpp @@ -39,10 +39,10 @@ namespace events { class Get : public Event { public: - Get(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Get& msg); + Get(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Get& msg); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override {} diff --git a/src/server/events/Mark.cpp b/src/server/events/Mark.cpp index 4f9b1261..314805f5 100644 --- a/src/server/events/Mark.cpp +++ b/src/server/events/Mark.cpp @@ -27,7 +27,7 @@ namespace server { namespace events { Mark::Mark(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::BundleBegin& msg) : Event(engine, client, msg.seq, timestamp) @@ -36,7 +36,7 @@ Mark::Mark(Engine& engine, {} Mark::Mark(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::BundleEnd& msg) : Event(engine, client, msg.seq, timestamp) diff --git a/src/server/events/Mark.hpp b/src/server/events/Mark.hpp index ad8cb66b..c32c2588 100644 --- a/src/server/events/Mark.hpp +++ b/src/server/events/Mark.hpp @@ -41,12 +41,12 @@ class Mark : public Event { public: Mark(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::BundleBegin& msg); Mark(Engine& engine, - SPtr<Interface> client, + const SPtr<Interface>& client, SampleCount timestamp, const ingen::BundleEnd& msg); diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index c7478898..857be189 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -31,10 +31,10 @@ namespace ingen { namespace server { namespace events { -Move::Move(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Move& msg) +Move::Move(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Move& msg) : Event(engine, client, msg.seq, timestamp) , _msg(msg) { diff --git a/src/server/events/Move.hpp b/src/server/events/Move.hpp index 327b31b9..b4487b78 100644 --- a/src/server/events/Move.hpp +++ b/src/server/events/Move.hpp @@ -36,10 +36,10 @@ namespace events { class Move : public Event { public: - Move(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Move& msg); + Move(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Move& msg); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index 9193f876..02f3f66b 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -37,14 +37,14 @@ namespace server { namespace events { /** Internal */ -SetPortValue::SetPortValue(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Atom& value, - bool activity, - bool synthetic) +SetPortValue::SetPortValue(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + PortImpl* port, + const Atom& value, + bool activity, + bool synthetic) : Event(engine, client, id, timestamp) , _port(port) , _value(value) diff --git a/src/server/events/SetPortValue.hpp b/src/server/events/SetPortValue.hpp index 1e7c7250..99d55af3 100644 --- a/src/server/events/SetPortValue.hpp +++ b/src/server/events/SetPortValue.hpp @@ -40,14 +40,14 @@ namespace events { class SetPortValue : public Event { public: - SetPortValue(Engine& engine, - SPtr<Interface> client, - int32_t id, - SampleCount timestamp, - PortImpl* port, - const Atom& value, - bool activity, - bool synthetic = false); + SetPortValue(Engine& engine, + const SPtr<Interface>& client, + int32_t id, + SampleCount timestamp, + PortImpl* port, + const Atom& value, + bool activity, + bool synthetic = false); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/events/Undo.cpp b/src/server/events/Undo.cpp index 3a3bdbe2..0741e60d 100644 --- a/src/server/events/Undo.cpp +++ b/src/server/events/Undo.cpp @@ -27,24 +27,24 @@ namespace ingen { namespace server { namespace events { -Undo::Undo(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Undo& msg) +Undo::Undo(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Undo& msg) : Event(engine, client, msg.seq, timestamp) , _is_redo(false) {} -Undo::Undo(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Redo& msg) +Undo::Undo(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Redo& msg) : Event(engine, client, msg.seq, timestamp) , _is_redo(true) {} bool -Undo::pre_process(PreProcessContext& ctx) +Undo::pre_process(PreProcessContext&) { const UPtr<UndoStack>& stack = _is_redo ? _engine.redo_stack() : _engine.undo_stack(); const Event::Mode mode = _is_redo ? Event::Mode::REDO : Event::Mode::UNDO; diff --git a/src/server/events/Undo.hpp b/src/server/events/Undo.hpp index f8469960..e36ebaad 100644 --- a/src/server/events/Undo.hpp +++ b/src/server/events/Undo.hpp @@ -32,15 +32,15 @@ namespace events { class Undo : public Event { public: - Undo(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Undo& msg); - - Undo(Engine& engine, - SPtr<Interface> client, - SampleCount timestamp, - const ingen::Redo& msg); + Undo(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Undo& msg); + + Undo(Engine& engine, + const SPtr<Interface>& client, + SampleCount timestamp, + const ingen::Redo& msg); bool pre_process(PreProcessContext& ctx) override; void execute(RunContext& context) override; diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 5ef3a321..57663344 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -425,7 +425,7 @@ using namespace ingen; using namespace ingen::server; static void -ingen_lv2_main(SPtr<Engine> engine, const SPtr<LV2Driver>& driver) +ingen_lv2_main(const SPtr<Engine>& engine, const SPtr<LV2Driver>& driver) { while (true) { // Wait until there is work to be done |