summaryrefslogtreecommitdiffstats
path: root/src/server/PatchImpl.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-15 05:24:41 +0000
committerDavid Robillard <d@drobilla.net>2012-08-15 05:24:41 +0000
commit5dd1d9b720993fc7813fe12fca0844f95033ff1b (patch)
tree344151dd656894340d217a8fe33f8dba53fe160f /src/server/PatchImpl.hpp
parent0a9297ed2a1622d252a389d8babc0656fedbe7fd (diff)
downloadingen-5dd1d9b720993fc7813fe12fca0844f95033ff1b.tar.gz
ingen-5dd1d9b720993fc7813fe12fca0844f95033ff1b.tar.bz2
ingen-5dd1d9b720993fc7813fe12fca0844f95033ff1b.zip
Use intrusive lists to store nodes and ports in their parent patch to avoid tedious allocated list node juggling.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4700 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PatchImpl.hpp')
-rw-r--r--src/server/PatchImpl.hpp43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/server/PatchImpl.hpp b/src/server/PatchImpl.hpp
index ac8a80ca..793f535b 100644
--- a/src/server/PatchImpl.hpp
+++ b/src/server/PatchImpl.hpp
@@ -18,12 +18,11 @@
#define INGEN_ENGINE_PATCHIMPL_HPP
#include <cstdlib>
-#include <list>
-#include <string>
#include "raul/List.hpp"
#include "CompiledPatch.hpp"
+#include "DuplexPort.hpp"
#include "NodeImpl.hpp"
#include "PluginImpl.hpp"
#include "PortType.hpp"
@@ -96,38 +95,40 @@ public:
// Patch specific stuff not inherited from Node
- typedef Raul::List<NodeImpl*> Nodes;
+ typedef boost::intrusive::slist<
+ NodeImpl, boost::intrusive::constant_time_size<true> > Nodes;
- void add_node(Nodes::Node* tn);
- Nodes::Node* remove_node(const Raul::Symbol& symbol);
+ void add_node(NodeImpl& node);
+ void remove_node(NodeImpl& node);
Nodes& nodes() { return _nodes; }
const Nodes& nodes() const { return _nodes; }
uint32_t num_ports_non_rt() const;
- PortImpl* create_port(BufferFactory& bufs,
- const Raul::Symbol& symbol,
- PortType type,
- LV2_URID buffer_type,
- uint32_t buffer_size,
- bool is_output,
- bool polyphonic);
+ DuplexPort* create_port(BufferFactory& bufs,
+ const Raul::Symbol& symbol,
+ PortType type,
+ LV2_URID buffer_type,
+ uint32_t buffer_size,
+ bool is_output,
+ bool polyphonic);
- typedef Raul::List<PortImpl*> Ports;
+ typedef boost::intrusive::slist<
+ DuplexPort, boost::intrusive::constant_time_size<true> > Ports;
- void add_input(Ports::Node* port) {
+ void add_input(DuplexPort& port) {
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- _inputs.push_back(port);
+ _inputs.push_front(port);
}
- void add_output(Ports::Node* port) {
+ void add_output(DuplexPort& port) {
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- _outputs.push_back(port);
+ _outputs.push_front(port);
}
- Ports::Node* remove_port(const Raul::Symbol& symbol);
- void clear_ports();
+ void remove_port(DuplexPort& port);
+ void clear_ports();
void add_edge(SharedPtr<EdgeImpl> c);
@@ -142,8 +143,8 @@ public:
Raul::Array<PortImpl*>* external_ports() { return _ports; }
void external_ports(Raul::Array<PortImpl*>* pa) { _ports = pa; }
- CompiledPatch* compile() const;
- Raul::Array<PortImpl*>* build_ports_array() const;
+ CompiledPatch* compile();
+ Raul::Array<PortImpl*>* build_ports_array();
/** Whether to run this patch's DSP bits in the audio thread */
bool enabled() const { return _process; }