diff options
author | David Robillard <d@drobilla.net> | 2017-10-05 21:52:50 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-10-07 12:47:52 +0200 |
commit | 6f330e18a769e96b07bdd7e7214605a9e5e3ec58 (patch) | |
tree | a002d4a5502fac3d5799e5669434ec26a27f4784 /src/server/CompiledGraph.cpp | |
parent | 5f3808170d643b17c721220b926fdd51a133322c (diff) | |
download | ingen-6f330e18a769e96b07bdd7e7214605a9e5e3ec58.tar.gz ingen-6f330e18a769e96b07bdd7e7214605a9e5e3ec58.tar.bz2 ingen-6f330e18a769e96b07bdd7e7214605a9e5e3ec58.zip |
Remove Log and Path dependency from CompiledGraph
Diffstat (limited to 'src/server/CompiledGraph.cpp')
-rw-r--r-- | src/server/CompiledGraph.cpp | 18 |
1 files changed, 9 insertions, 9 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"); } |