summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 16:34:02 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit8a7cc98bd39e95fbdab7bbb8e3e6e4aa351c219b (patch)
tree8bd1158a4b0ae665e395b14832e3e504e7cf2f7d /src/client
parent6436ce26daefba37c7a612591a33b18365db69b7 (diff)
downloadingen-8a7cc98bd39e95fbdab7bbb8e3e6e4aa351c219b.tar.gz
ingen-8a7cc98bd39e95fbdab7bbb8e3e6e4aa351c219b.tar.bz2
ingen-8a7cc98bd39e95fbdab7bbb8e3e6e4aa351c219b.zip
Remove wrappers for standard memory functions
Diffstat (limited to 'src/client')
-rw-r--r--src/client/BlockModel.cpp7
-rw-r--r--src/client/ClientStore.cpp33
-rw-r--r--src/client/GraphModel.cpp15
-rw-r--r--src/client/PortModel.cpp3
4 files changed, 31 insertions, 27 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp
index 3d68d8da..d672b439 100644
--- a/src/client/BlockModel.cpp
+++ b/src/client/BlockModel.cpp
@@ -24,6 +24,7 @@
#include <cmath>
#include <cstdlib>
#include <cstring>
+#include <memory>
#include <string>
namespace ingen {
@@ -107,7 +108,7 @@ BlockModel::add_child(const SPtr<ObjectModel>& c)
//ObjectModel::add_child(c);
- SPtr<PortModel> pm = dynamic_ptr_cast<PortModel>(c);
+ SPtr<PortModel> pm = std::dynamic_pointer_cast<PortModel>(c);
assert(pm);
add_port(pm);
}
@@ -120,7 +121,7 @@ BlockModel::remove_child(const SPtr<ObjectModel>& c)
//bool ret = ObjectModel::remove_child(c);
- SPtr<PortModel> pm = dynamic_ptr_cast<PortModel>(c);
+ SPtr<PortModel> pm = std::dynamic_pointer_cast<PortModel>(c);
assert(pm);
remove_port(pm);
@@ -274,7 +275,7 @@ BlockModel::port_label(const SPtr<const PortModel>& port) const
void
BlockModel::set(const SPtr<ObjectModel>& model)
{
- SPtr<BlockModel> block = dynamic_ptr_cast<BlockModel>(model);
+ SPtr<BlockModel> block = std::dynamic_pointer_cast<BlockModel>(model);
if (block) {
_plugin_uri = block->_plugin_uri;
_plugin = block->_plugin;
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index a0c30c85..279d0cc6 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -29,6 +29,7 @@
#include <cassert>
#include <cstdint>
+#include <memory>
#include <string>
#include <utility>
@@ -63,7 +64,7 @@ ClientStore::add_object(const SPtr<ObjectModel>& object)
// one (with precedence to the new values).
auto existing = find(object->path());
if (existing != end()) {
- dynamic_ptr_cast<ObjectModel>(existing->second)->set(object);
+ std::dynamic_pointer_cast<ObjectModel>(existing->second)->set(object);
} else {
if (!object->path().is_root()) {
SPtr<ObjectModel> parent = _object(object->path().parent());
@@ -98,12 +99,12 @@ ClientStore::remove_object(const Raul::Path& path)
return SPtr<ObjectModel>();
}
- SPtr<ObjectModel> object = dynamic_ptr_cast<ObjectModel>(top->second);
+ SPtr<ObjectModel> object = std::dynamic_pointer_cast<ObjectModel>(top->second);
// Remove object and any adjacent arcs from parent if applicable
if (object && object->parent()) {
- SPtr<PortModel> port = dynamic_ptr_cast<PortModel>(object);
- if (port && dynamic_ptr_cast<GraphModel>(port->parent())) {
+ SPtr<PortModel> port = std::dynamic_pointer_cast<PortModel>(object);
+ if (port && std::dynamic_pointer_cast<GraphModel>(port->parent())) {
disconnect_all(port->parent()->path(), path);
if (port->parent()->parent()) {
disconnect_all(port->parent()->parent()->path(), path);
@@ -159,7 +160,7 @@ ClientStore::_object(const Raul::Path& path)
if (i == end()) {
return SPtr<ObjectModel>();
} else {
- SPtr<ObjectModel> model = dynamic_ptr_cast<ObjectModel>(i->second);
+ SPtr<ObjectModel> model = std::dynamic_pointer_cast<ObjectModel>(i->second);
assert(model);
assert(model->path().is_root() || model->parent());
return model;
@@ -289,7 +290,7 @@ ClientStore::operator()(const Put& msg)
const Raul::Path path(uri_to_path(uri));
- SPtr<ObjectModel> obj = dynamic_ptr_cast<ObjectModel>(_object(path));
+ SPtr<ObjectModel> obj = std::dynamic_pointer_cast<ObjectModel>(_object(path));
if (obj) {
obj->set_properties(properties);
return;
@@ -407,19 +408,19 @@ ClientStore::connection_graph(const Raul::Path& tail_path,
SPtr<GraphModel> graph;
if (tail_path.parent() == head_path.parent()) {
- graph = dynamic_ptr_cast<GraphModel>(_object(tail_path.parent()));
+ graph = std::dynamic_pointer_cast<GraphModel>(_object(tail_path.parent()));
}
if (!graph && tail_path.parent() == head_path.parent().parent()) {
- graph = dynamic_ptr_cast<GraphModel>(_object(tail_path.parent()));
+ graph = std::dynamic_pointer_cast<GraphModel>(_object(tail_path.parent()));
}
if (!graph && tail_path.parent().parent() == head_path.parent()) {
- graph = dynamic_ptr_cast<GraphModel>(_object(head_path.parent()));
+ graph = std::dynamic_pointer_cast<GraphModel>(_object(head_path.parent()));
}
if (!graph) {
- graph = dynamic_ptr_cast<GraphModel>(_object(tail_path.parent().parent()));
+ graph = std::dynamic_pointer_cast<GraphModel>(_object(tail_path.parent().parent()));
}
if (!graph) {
@@ -434,8 +435,8 @@ bool
ClientStore::attempt_connection(const Raul::Path& tail_path,
const Raul::Path& head_path)
{
- SPtr<PortModel> tail = dynamic_ptr_cast<PortModel>(_object(tail_path));
- SPtr<PortModel> head = dynamic_ptr_cast<PortModel>(_object(head_path));
+ SPtr<PortModel> tail = std::dynamic_pointer_cast<PortModel>(_object(tail_path));
+ SPtr<PortModel> head = std::dynamic_pointer_cast<PortModel>(_object(head_path));
if (tail && head) {
SPtr<GraphModel> graph = connection_graph(tail_path, head_path);
@@ -457,8 +458,8 @@ ClientStore::operator()(const Connect& msg)
void
ClientStore::operator()(const Disconnect& msg)
{
- SPtr<PortModel> tail = dynamic_ptr_cast<PortModel>(_object(msg.tail));
- SPtr<PortModel> head = dynamic_ptr_cast<PortModel>(_object(msg.head));
+ SPtr<PortModel> tail = std::dynamic_pointer_cast<PortModel>(_object(msg.tail));
+ SPtr<PortModel> head = std::dynamic_pointer_cast<PortModel>(_object(msg.head));
SPtr<GraphModel> graph = connection_graph(msg.tail, msg.head);
if (graph) {
graph->remove_arc(tail.get(), head.get());
@@ -468,7 +469,7 @@ ClientStore::operator()(const Disconnect& msg)
void
ClientStore::operator()(const DisconnectAll& msg)
{
- SPtr<GraphModel> graph = dynamic_ptr_cast<GraphModel>(_object(msg.graph));
+ SPtr<GraphModel> graph = std::dynamic_pointer_cast<GraphModel>(_object(msg.graph));
SPtr<ObjectModel> object = _object(msg.path);
if (!graph || !object) {
@@ -479,7 +480,7 @@ ClientStore::operator()(const DisconnectAll& msg)
const GraphModel::Arcs arcs = graph->arcs();
for (const auto& a : arcs) {
- SPtr<ArcModel> arc = dynamic_ptr_cast<ArcModel>(a.second);
+ SPtr<ArcModel> arc = std::dynamic_pointer_cast<ArcModel>(a.second);
if (arc->tail()->parent() == object
|| arc->head()->parent() == object
|| arc->tail()->path() == msg.path
diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp
index 90ab2964..a2d50a20 100644
--- a/src/client/GraphModel.cpp
+++ b/src/client/GraphModel.cpp
@@ -22,6 +22,7 @@
#include "ingen/client/ClientStore.hpp"
#include <cassert>
+#include <memory>
#include <string>
#include <utility>
@@ -33,13 +34,13 @@ GraphModel::add_child(const SPtr<ObjectModel>& c)
{
assert(c->parent().get() == this);
- SPtr<PortModel> pm = dynamic_ptr_cast<PortModel>(c);
+ SPtr<PortModel> pm = std::dynamic_pointer_cast<PortModel>(c);
if (pm) {
add_port(pm);
return;
}
- SPtr<BlockModel> bm = dynamic_ptr_cast<BlockModel>(c);
+ SPtr<BlockModel> bm = std::dynamic_pointer_cast<BlockModel>(c);
if (bm) {
_signal_new_block.emit(bm);
}
@@ -51,13 +52,13 @@ GraphModel::remove_child(const SPtr<ObjectModel>& o)
assert(o->path().is_child_of(path()));
assert(o->parent().get() == this);
- SPtr<PortModel> pm = dynamic_ptr_cast<PortModel>(o);
+ SPtr<PortModel> pm = std::dynamic_pointer_cast<PortModel>(o);
if (pm) {
remove_arcs_on(pm);
remove_port(pm);
}
- SPtr<BlockModel> bm = dynamic_ptr_cast<BlockModel>(o);
+ SPtr<BlockModel> bm = std::dynamic_pointer_cast<BlockModel>(o);
if (bm) {
_signal_removed_block.emit(bm);
}
@@ -74,7 +75,7 @@ GraphModel::remove_arcs_on(const SPtr<PortModel>& p)
auto next = j;
++next;
- SPtr<ArcModel> arc = dynamic_ptr_cast<ArcModel>(j->second);
+ SPtr<ArcModel> arc = std::dynamic_pointer_cast<ArcModel>(j->second);
if (arc->tail_path().parent() == p->path()
|| arc->tail_path() == p->path()
|| arc->head_path().parent() == p->path()
@@ -102,7 +103,7 @@ GraphModel::get_arc(const Node* tail, const Node* head)
{
auto i = _arcs.find(std::make_pair(tail, head));
if (i != _arcs.end()) {
- return dynamic_ptr_cast<ArcModel>(i->second);
+ return std::dynamic_pointer_cast<ArcModel>(i->second);
} else {
return SPtr<ArcModel>();
}
@@ -148,7 +149,7 @@ GraphModel::remove_arc(const Node* tail, const Node* head)
{
auto i = _arcs.find(std::make_pair(tail, head));
if (i != _arcs.end()) {
- SPtr<ArcModel> arc = dynamic_ptr_cast<ArcModel>(i->second);
+ SPtr<ArcModel> arc = std::dynamic_pointer_cast<ArcModel>(i->second);
_signal_removed_arc.emit(arc);
_arcs.erase(i);
}
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp
index fa1a7abe..b3562f77 100644
--- a/src/client/PortModel.cpp
+++ b/src/client/PortModel.cpp
@@ -18,6 +18,7 @@
#include "ingen/client/PortModel.hpp"
#include <cstdint>
+#include <memory>
#include <utility>
namespace ingen {
@@ -69,7 +70,7 @@ PortModel::set(const SPtr<ObjectModel>& model)
{
ObjectModel::set(model);
- SPtr<PortModel> port = dynamic_ptr_cast<PortModel>(model);
+ SPtr<PortModel> port = std::dynamic_pointer_cast<PortModel>(model);
if (port) {
_index = port->_index;
_direction = port->_direction;