diff options
author | David Robillard <d@drobilla.net> | 2016-09-12 22:37:22 +0800 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-10-02 12:24:56 -0400 |
commit | 9b8bce71893ef450992f82a28a6a0287c479baaf (patch) | |
tree | 8c9c240e32f8201d2f999a2de2baaca6281783c3 /src/server/CompiledGraph.hpp | |
parent | 938456884934a74a2850c02edc17575021131709 (diff) | |
download | ingen-9b8bce71893ef450992f82a28a6a0287c479baaf.tar.gz ingen-9b8bce71893ef450992f82a28a6a0287c479baaf.tar.bz2 ingen-9b8bce71893ef450992f82a28a6a0287c479baaf.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); |