summaryrefslogtreecommitdiffstats
path: root/src/client/BlockModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-08 18:03:43 +0100
committerDavid Robillard <d@drobilla.net>2019-12-08 20:59:06 +0100
commitc35cbf038d0992887b8d4bcf5d4ff83c323ec60c (patch)
tree02384c6a8671e866a54cbd9f6002a3dd145116b9 /src/client/BlockModel.cpp
parent8215246d12f49573f7ebcdc62ddae84185c22bfe (diff)
downloadingen-c35cbf038d0992887b8d4bcf5d4ff83c323ec60c.tar.gz
ingen-c35cbf038d0992887b8d4bcf5d4ff83c323ec60c.tar.bz2
ingen-c35cbf038d0992887b8d4bcf5d4ff83c323ec60c.zip
Cleanup: Avoid parameter copying overhead
Diffstat (limited to 'src/client/BlockModel.cpp')
-rw-r--r--src/client/BlockModel.cpp34
1 files changed, 17 insertions, 17 deletions
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) {