diff options
author | David Robillard <d@drobilla.net> | 2012-07-30 23:00:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-07-30 23:00:13 +0000 |
commit | 0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39 (patch) | |
tree | afcba1a0ba16837f7b6f1a4822b7164deccb61e7 /src/client | |
parent | 921881813d7fb2e46a0e65d1e888f6cd9a928945 (diff) | |
download | ingen-0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39.tar.gz ingen-0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39.tar.bz2 ingen-0e1bf6ddfc77866ff6477a3f394c030c2a5e1b39.zip |
Eliminate pure virtual base classes Patch, Node, and Port, and the virtual inheritance they imposed.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4576 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/NodeModel.cpp | 16 | ||||
-rw-r--r-- | src/client/PatchModel.cpp | 24 |
2 files changed, 18 insertions, 22 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index a92d5aae..2a88b4db 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -18,7 +18,6 @@ #include <cmath> #include <string> -#include "ingen/Port.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" @@ -29,8 +28,7 @@ namespace Client { NodeModel::NodeModel(Shared::URIs& uris, SharedPtr<PluginModel> plugin, const Raul::Path& path) - : Node() - , ObjectModel(uris, path) + : ObjectModel(uris, path) , _plugin_uri(plugin->uri()) , _plugin(plugin) , _num_values(0) @@ -42,8 +40,7 @@ NodeModel::NodeModel(Shared::URIs& uris, NodeModel::NodeModel(Shared::URIs& uris, const Raul::URI& plugin_uri, const Raul::Path& path) - : Node() - , ObjectModel(uris, path) + : ObjectModel(uris, path) , _plugin_uri(plugin_uri) , _num_values(0) , _min_values(0) @@ -52,8 +49,7 @@ NodeModel::NodeModel(Shared::URIs& uris, } NodeModel::NodeModel(const NodeModel& copy) - : Node(copy) - , ObjectModel(copy) + : ObjectModel(copy) , _plugin_uri(copy._plugin_uri) , _num_values(copy._num_values) , _min_values((float*)malloc(sizeof(float) * _num_values)) @@ -153,12 +149,12 @@ NodeModel::get_port(const Raul::Symbol& symbol) const return SharedPtr<PortModel>(); } -Ingen::Port* +Ingen::GraphObject* NodeModel::port(uint32_t index) const { assert(index < num_ports()); - return const_cast<Ingen::Port*>( - dynamic_cast<const Ingen::Port*>(_ports[index].get())); + return const_cast<Ingen::GraphObject*>( + dynamic_cast<const Ingen::GraphObject*>(_ports[index].get())); } void diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index df6f63c0..7acb8aec 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -53,7 +53,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) // Remove any connections which referred to this object, // since they can't possibly exist anymore - for (Edges::iterator j = _edges->begin(); j != _edges->end();) { + for (Edges::iterator j = _edges.begin(); j != _edges.end();) { Edges::iterator next = j; ++next; @@ -65,7 +65,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) || cm->head_path().parent() == o->path() || cm->head_path() == o->path()) { _signal_removed_edge.emit(cm); - _edges->erase(j); // cuts our reference + _edges.erase(j); // cuts our reference } j = next; } @@ -84,19 +84,19 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) void PatchModel::clear() { - _edges->clear(); + _edges.clear(); NodeModel::clear(); - assert(_edges->empty()); + assert(_edges.empty()); assert(_ports.empty()); } SharedPtr<EdgeModel> -PatchModel::get_edge(const Port* tail, const Ingen::Port* head) +PatchModel::get_edge(const GraphObject* tail, const GraphObject* head) { - Edges::iterator i = _edges->find(make_pair(tail, head)); - if (i != _edges->end()) + Edges::iterator i = _edges.find(make_pair(tail, head)); + if (i != _edges.end()) return PtrCast<EdgeModel>(i->second); else return SharedPtr<EdgeModel>(); @@ -131,20 +131,20 @@ PatchModel::add_edge(SharedPtr<EdgeModel> cm) assert(cm->tail() == existing->tail()); assert(cm->head() == existing->head()); } else { - _edges->insert(make_pair(make_pair(cm->tail().get(), + _edges.insert(make_pair(make_pair(cm->tail().get(), cm->head().get()), cm)); _signal_new_edge.emit(cm); } } void -PatchModel::remove_edge(const Port* tail, const Ingen::Port* head) +PatchModel::remove_edge(const GraphObject* tail, const GraphObject* head) { - Edges::iterator i = _edges->find(make_pair(tail, head)); - if (i != _edges->end()) { + Edges::iterator i = _edges.find(make_pair(tail, head)); + if (i != _edges.end()) { SharedPtr<EdgeModel> c = PtrCast<EdgeModel>(i->second); _signal_removed_edge.emit(c); - _edges->erase(i); + _edges.erase(i); } else { Raul::warn(Raul::fmt("Failed to remove patch connection %1% => %2%\n") % tail->path() % head->path()); |