From b18b677b0b747ad4fbcd71102488b2cfab7cb3f9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 15 Aug 2008 02:48:48 +0000 Subject: Add strong Symbol class (just a restricted string, like path) and use it for ingen object symbols. git-svn-id: http://svn.drobilla.net/lad/ingen@1387 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/GraphObjectImpl.hpp | 3 ++- src/libs/engine/PatchImpl.cpp | 10 +++++----- src/libs/engine/QueuedEngineInterface.cpp | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/libs/engine') diff --git a/src/libs/engine/GraphObjectImpl.hpp b/src/libs/engine/GraphObjectImpl.hpp index b5a259af..f3c7286a 100644 --- a/src/libs/engine/GraphObjectImpl.hpp +++ b/src/libs/engine/GraphObjectImpl.hpp @@ -30,6 +30,7 @@ using Raul::Atom; using Raul::Path; +using Raul::Symbol; namespace Raul { class Maid; } @@ -58,7 +59,7 @@ public: GraphObject* graph_parent() const { return _parent; } inline GraphObjectImpl* parent() const { return _parent; } - const std::string name() const { return _name; } + const Symbol symbol() const { return _name; } virtual void process(ProcessContext& context) = 0; diff --git a/src/libs/engine/PatchImpl.cpp b/src/libs/engine/PatchImpl.cpp index aedaacbf..97f9dde3 100644 --- a/src/libs/engine/PatchImpl.cpp +++ b/src/libs/engine/PatchImpl.cpp @@ -274,11 +274,11 @@ PatchImpl::add_node(List::Node* ln) * Preprocessing thread only. */ PatchImpl::Nodes::Node* -PatchImpl::remove_node(const string& name) +PatchImpl::remove_node(const string& symbol) { assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); for (List::iterator i = _nodes.begin(); i != _nodes.end(); ++i) - if ((*i)->name() == name) + if ((*i)->symbol() == symbol) return _nodes.erase(i); return NULL; @@ -360,14 +360,14 @@ PatchImpl::create_port(const string& name, DataType type, size_t buffer_size, bo * Realtime safe. Preprocessing thread only. */ List::Node* -PatchImpl::remove_port(const string& name) +PatchImpl::remove_port(const string& symbol) { assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); bool found = false; List::Node* ret = NULL; for (List::iterator i = _input_ports.begin(); i != _input_ports.end(); ++i) { - if ((*i)->name() == name) { + if ((*i)->symbol() == symbol) { ret = _input_ports.erase(i); found = true; } @@ -375,7 +375,7 @@ PatchImpl::remove_port(const string& name) if (!found) for (List::iterator i = _output_ports.begin(); i != _output_ports.end(); ++i) { - if ((*i)->name() == name) { + if ((*i)->symbol() == symbol) { ret = _output_ports.erase(i); found = true; } diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp index d6792b09..988093aa 100644 --- a/src/libs/engine/QueuedEngineInterface.cpp +++ b/src/libs/engine/QueuedEngineInterface.cpp @@ -176,9 +176,9 @@ QueuedEngineInterface::create_node(const string& path, void QueuedEngineInterface::rename(const string& old_path, - const string& new_name) + const string& new_symbol) { - push_queued(new RenameEvent(_engine, _responder, now(), old_path, new_name)); + push_queued(new RenameEvent(_engine, _responder, now(), old_path, new_symbol)); } -- cgit v1.2.1