diff options
author | David Robillard <d@drobilla.net> | 2016-09-12 22:37:22 +0800 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-10-01 12:25:43 -0400 |
commit | fed7aaf0901e1b26dcc2bbb222f67b11f6b9d291 (patch) | |
tree | 8ae07a75439481109da586b211c4da85fca8730b /src/server/CompiledGraph.hpp | |
parent | 11b55676a510171a56975743fd752ccbcc170622 (diff) | |
download | ingen-fed7aaf0901e1b26dcc2bbb222f67b11f6b9d291.tar.gz ingen-fed7aaf0901e1b26dcc2bbb222f67b11f6b9d291.tar.bz2 ingen-fed7aaf0901e1b26dcc2bbb222f67b11f6b9d291.zip |
Add parallel graph execution
Diffstat (limited to 'src/server/CompiledGraph.hpp')
-rw-r--r-- | src/server/CompiledGraph.hpp | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index 663752e3..7dc40865 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2015 David Robillard <http://drobilla.net/> + Copyright 2007-2016 David Robillard <http://drobilla.net/> Ingen is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free @@ -17,7 +17,7 @@ #ifndef INGEN_ENGINE_COMPILEDGRAPH_HPP #define INGEN_ENGINE_COMPILEDGRAPH_HPP -#include <ostream> +#include <functional> #include <set> #include <vector> @@ -25,6 +25,8 @@ #include "raul/Noncopyable.hpp" #include "raul/Path.hpp" +#include "Task.hpp" + namespace Ingen { class Log; @@ -45,36 +47,11 @@ class CompiledGraph : public Raul::Maid::Disposable , public Raul::Noncopyable { public: - class Task : public std::vector<Task> { - public: - enum class Mode { - SINGLE, ///< Single block to run - SEQUENTIAL, ///< Elements must be run sequentially in order - PARALLEL ///< Elements may be run in any order in parallel - }; - - Task(Mode mode, BlockImpl* block=NULL) - : _mode(mode) - , _block(block) - {} - - void run(RunContext& context); - void dump(std::ostream& os, unsigned indent, bool first) const; - void simplify(); - - Mode mode() const { return _mode; } - BlockImpl* block() const { return _block; } - - private: - Mode _mode; ///< Execution mode - BlockImpl* _block; ///< Used for SINGLE only - }; - static CompiledGraph* compile(GraphImpl* graph); void run(RunContext& context); - void dump(std::ostream& os) const; + void dump(std::function<void (const std::string&)> sink) const; private: CompiledGraph(GraphImpl* graph); |