summaryrefslogtreecommitdiffstats
path: root/src/server/CompiledGraph.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-10-05 21:52:50 +0200
committerDavid Robillard <d@drobilla.net>2017-12-16 13:57:39 +0100
commit91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da (patch)
treec227883571bdd078c5e3656add580dc11efa3a1f /src/server/CompiledGraph.cpp
parent516552fe4f38ba82c72fe6ea32982c8a772f9088 (diff)
downloadingen-91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da.tar.gz
ingen-91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da.tar.bz2
ingen-91c3888b71ee8cfdd951cf2b80dfd37ce46ac8da.zip
Remove Log and Path dependency from CompiledGraph
Diffstat (limited to 'src/server/CompiledGraph.cpp')
-rw-r--r--src/server/CompiledGraph.cpp18
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");
}