summaryrefslogtreecommitdiffstats
path: root/ingen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 14:42:16 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commitdbb38be5ccda387ef458583b5a85c03b59a5e05c (patch)
treeca6e767d1e7d6aa86efa992c14b6f1e967309aa5 /ingen
parentcfee0cd7d2a704153df73449be38fcef60b958eb (diff)
downloadingen-dbb38be5ccda387ef458583b5a85c03b59a5e05c.tar.gz
ingen-dbb38be5ccda387ef458583b5a85c03b59a5e05c.tar.bz2
ingen-dbb38be5ccda387ef458583b5a85c03b59a5e05c.zip
Fix unnecessary parameter copies
Diffstat (limited to 'ingen')
-rw-r--r--ingen/Interface.hpp2
-rw-r--r--ingen/Log.hpp2
-rw-r--r--ingen/Tee.hpp2
-rw-r--r--ingen/World.hpp7
-rw-r--r--ingen/client/ClientStore.hpp12
-rw-r--r--ingen/client/PluginModel.hpp6
-rw-r--r--ingen/client/PluginUI.hpp6
-rw-r--r--ingen/client/SocketClient.hpp22
8 files changed, 30 insertions, 29 deletions
diff --git a/ingen/Interface.hpp b/ingen/Interface.hpp
index 981b7dd5..10d7d4bf 100644
--- a/ingen/Interface.hpp
+++ b/ingen/Interface.hpp
@@ -57,7 +57,7 @@ public:
virtual SPtr<Interface> respondee() const { return SPtr<Interface>(); }
- virtual void set_respondee(SPtr<Interface> respondee) {}
+ virtual void set_respondee(const SPtr<Interface>& respondee) {}
virtual void message(const Message& msg) = 0;
diff --git a/ingen/Log.hpp b/ingen/Log.hpp
index e6bc2b39..d668e873 100644
--- a/ingen/Log.hpp
+++ b/ingen/Log.hpp
@@ -90,7 +90,7 @@ public:
void set_flush(bool f) { _flush = f; }
void set_trace(bool f) { _trace = f; }
- void set_sink(Sink s) { _sink = s; }
+ void set_sink(Sink s) { _sink = std::move(s); }
private:
void print(FILE* stream, const std::string& msg) const;
diff --git a/ingen/Tee.hpp b/ingen/Tee.hpp
index bf3fd335..b13b9e95 100644
--- a/ingen/Tee.hpp
+++ b/ingen/Tee.hpp
@@ -40,7 +40,7 @@ public:
return _sinks.front()->respondee();
}
- void set_respondee(SPtr<Interface> respondee) override {
+ void set_respondee(const SPtr<Interface>& respondee) override {
_sinks.front()->set_respondee(respondee);
}
diff --git a/ingen/World.hpp b/ingen/World.hpp
index a2906525..b5fc7350 100644
--- a/ingen/World.hpp
+++ b/ingen/World.hpp
@@ -89,9 +89,10 @@ public:
virtual bool run_module(const char* name);
/** A function to create a new remote Interface. */
- typedef SPtr<Interface> (*InterfaceFactory)(World& world,
- const URI& engine_uri,
- SPtr<Interface> respondee);
+ typedef SPtr<Interface> (*InterfaceFactory)(
+ World& world,
+ const URI& engine_uri,
+ const SPtr<Interface>& respondee);
/** Register an InterfaceFactory (for module implementations). */
virtual void add_interface_factory(const std::string& scheme,
diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp
index 9576cd3c..109bd835 100644
--- a/ingen/client/ClientStore.hpp
+++ b/ingen/client/ClientStore.hpp
@@ -59,9 +59,9 @@ class INGEN_API ClientStore : public Store
, public INGEN_TRACKABLE {
public:
ClientStore(
- URIs& uris,
- Log& log,
- SPtr<SigClientInterface> emitter = SPtr<SigClientInterface>());
+ URIs& uris,
+ Log& log,
+ const SPtr<SigClientInterface>& emitter = SPtr<SigClientInterface>());
URI uri() const override { return URI("ingen:/clients/store"); }
@@ -75,7 +75,7 @@ public:
SPtr<const Plugins> plugins() const { return _plugins; }
SPtr<Plugins> plugins() { return _plugins; }
- void set_plugins(SPtr<Plugins> p) { _plugins = p; }
+ void set_plugins(SPtr<Plugins> p) { _plugins = std::move(p); }
URIs& uris() { return _uris; }
@@ -108,10 +108,10 @@ private:
SPtr<PluginModel> _plugin(const Atom& uri);
SPtr<Resource> _resource(const URI& uri);
- void add_object(SPtr<ObjectModel> object);
+ void add_object(const SPtr<ObjectModel>& object);
SPtr<ObjectModel> remove_object(const Raul::Path& path);
- void add_plugin(SPtr<PluginModel> pm);
+ void add_plugin(const SPtr<PluginModel>& pm);
SPtr<GraphModel> connection_graph(const Raul::Path& tail_path,
const Raul::Path& head_path);
diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp
index dc0c724f..10ab3a6a 100644
--- a/ingen/client/PluginModel.hpp
+++ b/ingen/client/PluginModel.hpp
@@ -82,8 +82,8 @@ public:
bool has_ui() const;
- SPtr<PluginUI> ui(ingen::World& world,
- SPtr<const BlockModel> block) const;
+ SPtr<PluginUI>
+ ui(ingen::World& world, const SPtr<const BlockModel>& block) const;
std::string documentation(bool html) const;
std::string port_documentation(uint32_t index, bool html) const;
@@ -104,7 +104,7 @@ public:
protected:
friend class ClientStore;
- void set(SPtr<PluginModel> p);
+ void set(const SPtr<PluginModel>& p);
void add_preset(const URI& uri, const std::string& label);
diff --git a/ingen/client/PluginUI.hpp b/ingen/client/PluginUI.hpp
index b5d467ea..70ff7274 100644
--- a/ingen/client/PluginUI.hpp
+++ b/ingen/client/PluginUI.hpp
@@ -53,9 +53,9 @@ public:
* connected first. The caller should connect to signal_property_changed,
* then call instantiate().
*/
- static SPtr<PluginUI> create(ingen::World& world,
- SPtr<const BlockModel> block,
- const LilvPlugin* plugin);
+ static SPtr<PluginUI> create(ingen::World& world,
+ const SPtr<const BlockModel>& block,
+ const LilvPlugin* plugin);
/** Instantiate the UI.
*
diff --git a/ingen/client/SocketClient.hpp b/ingen/client/SocketClient.hpp
index 092ef9d2..8e551821 100644
--- a/ingen/client/SocketClient.hpp
+++ b/ingen/client/SocketClient.hpp
@@ -29,27 +29,27 @@ namespace client {
class INGEN_API SocketClient : public SocketWriter
{
public:
- SocketClient(World& world,
- const URI& uri,
- SPtr<Raul::Socket> sock,
- SPtr<Interface> respondee)
- : SocketWriter(world.uri_map(), world.uris(), uri, sock)
- , _respondee(respondee)
- , _reader(world, *respondee.get(), sock)
+ SocketClient(World& world,
+ const URI& uri,
+ const SPtr<Raul::Socket>& sock,
+ const SPtr<Interface>& respondee)
+ : SocketWriter(world.uri_map(), world.uris(), uri, sock)
+ , _respondee(respondee)
+ , _reader(world, *respondee.get(), sock)
{}
SPtr<Interface> respondee() const override {
return _respondee;
}
- void set_respondee(SPtr<Interface> respondee) override {
+ void set_respondee(const SPtr<Interface>& respondee) override {
_respondee = respondee;
}
static SPtr<ingen::Interface>
- new_socket_interface(ingen::World& world,
- const URI& uri,
- SPtr<ingen::Interface> respondee)
+ new_socket_interface(ingen::World& world,
+ const URI& uri,
+ const SPtr<ingen::Interface>& respondee)
{
const Raul::Socket::Type type = (uri.scheme() == "unix"
? Raul::Socket::Type::UNIX