diff options
author | David Robillard <d@drobilla.net> | 2017-10-05 21:52:50 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-16 13:57:39 +0100 |
commit | 91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da (patch) | |
tree | c227883571bdd078c5e3656add580dc11efa3a1f | |
parent | 516552fe4f38ba82c72fe6ea32982c8a772f9088 (diff) | |
download | ingen-91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da.tar.gz ingen-91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da.tar.bz2 ingen-91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da.zip |
Remove Log and Path dependency from CompiledGraph
-rw-r--r-- | src/server/CompiledGraph.cpp | 18 | ||||
-rw-r--r-- | src/server/CompiledGraph.hpp | 12 |
2 files changed, 12 insertions, 18 deletions
diff --git a/src/server/CompiledGraph.cpp b/src/server/CompiledGraph.cpp index 337baf95..0d51f284 100644 --- a/src/server/CompiledGraph.cpp +++ b/src/server/CompiledGraph.cpp @@ -53,9 +53,7 @@ has_provider_with_many_dependants(BlockImpl* n) } CompiledGraph::CompiledGraph(GraphImpl* graph) - : _log(graph->engine().log()) - , _path(graph->path()) - , _master(Task::Mode::SEQUENTIAL) + : _master(Task::Mode::SEQUENTIAL) { compile_graph(graph); } @@ -146,10 +144,8 @@ CompiledGraph::compile_graph(GraphImpl* graph) _master = Task::simplify(std::move(_master)); if (graph->engine().world()->conf().option("trace").get<int32_t>()) { - dump([this](const std::string& msg) { - ColorContext ctx(stderr, ColorContext::Color::YELLOW); - fwrite(msg.c_str(), 1, msg.size(), stderr); - }); + ColorContext ctx(stderr, ColorContext::Color::YELLOW); + dump(graph->path()); } } @@ -261,10 +257,14 @@ CompiledGraph::run(RunContext& context) } void -CompiledGraph::dump(std::function<void (const std::string&)> sink) const +CompiledGraph::dump(const std::string& name) const { + auto sink = [](const std::string& s) { + fwrite(s.c_str(), 1, s.size(), stderr); + }; + sink("(compiled-graph "); - sink(_path); + sink(name); _master.dump(sink, 2, false); sink(")\n"); } diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index 8d6ebf52..c1e9efec 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -23,14 +23,10 @@ #include "raul/Maid.hpp" #include "raul/Noncopyable.hpp" -#include "raul/Path.hpp" #include "Task.hpp" namespace Ingen { - -class Log; - namespace Server { class BlockImpl; @@ -51,8 +47,6 @@ public: void run(RunContext& context); - void dump(std::function<void (const std::string&)> sink) const; - private: friend class Raul::Maid; ///< Allow make_managed to construct @@ -60,6 +54,8 @@ private: typedef std::set<BlockImpl*> BlockSet; + void dump(const std::string& name) const; + void compile_graph(GraphImpl* graph); void compile_block(BlockImpl* block, @@ -73,9 +69,7 @@ private: size_t max_depth, BlockSet& k); - Log& _log; - const Raul::Path _path; - Task _master; + Task _master; }; } // namespace Server |