From f8cd75372d9c45a0a8616d89a18a5b9906ac9d54 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Nov 2017 19:57:56 +0100 Subject: WIP: Clean up task implementation --- src/server/CompiledGraph.hpp | 53 ++++---------------------------------------- 1 file changed, 4 insertions(+), 49 deletions(-) (limited to 'src/server/CompiledGraph.hpp') diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index 833ae0c6..24a12351 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -17,66 +17,21 @@ #ifndef INGEN_ENGINE_COMPILEDGRAPH_HPP #define INGEN_ENGINE_COMPILEDGRAPH_HPP -#include -#include -#include - #include "ingen/types.hpp" #include "raul/Maid.hpp" -#include "raul/Noncopyable.hpp" #include "Task.hpp" namespace Ingen { namespace Server { -class BlockImpl; class GraphImpl; -class RunContext; - -/** A graph ``compiled'' into a quickly executable form. - * - * This is a flat sequence of nodes ordered such that the process thread can - * execute the nodes in order and have nodes always executed before any of - * their dependencies. - */ -class CompiledGraph : public Raul::Maid::Disposable - , public Raul::Noncopyable -{ -public: - static MPtr compile(Raul::Maid& maid, GraphImpl& graph); - - void run(RunContext& context); - -private: - friend class Raul::Maid; ///< Allow make_managed to construct - - CompiledGraph(GraphImpl* graph); - - typedef std::set BlockSet; - - void dump(const std::string& name) const; - - void compile_graph(GraphImpl* graph); - - void compile_block(BlockImpl* block, - Task& task, - size_t max_depth, - BlockSet& k); - - void compile_provider(const BlockImpl* root, - BlockImpl* block, - Task& task, - size_t max_depth, - BlockSet& k); +class BlockImpl; - Task _master; -}; +/** A graph ``compiled'' into an efficiently executable form. */ +using CompiledGraph = Raul::Maid::Managed; -inline MPtr compile(Raul::Maid& maid, GraphImpl& graph) -{ - return CompiledGraph::compile(maid, graph); -} +MPtr compile(Raul::Maid& maid, GraphImpl& graph); } // namespace Server } // namespace Ingen -- cgit v1.2.1