From 103fc81cf330aa1c47fa9f42b3551d426e1d3b7f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Nov 2017 18:18:06 +0100 Subject: Make CompiledGraph::compile a free function --- src/server/CompiledGraph.hpp | 6 ++++++ src/server/PreProcessContext.hpp | 2 +- src/server/events/Connect.cpp | 3 +-- src/server/events/Connect.hpp | 2 +- src/server/events/Copy.hpp | 2 +- src/server/events/CreateBlock.hpp | 2 +- src/server/events/CreateGraph.hpp | 2 +- src/server/events/Delete.hpp | 4 ++-- src/server/events/Delta.cpp | 3 +-- src/server/events/Delta.hpp | 4 ++-- src/server/events/Disconnect.hpp | 2 +- src/server/events/DisconnectAll.cpp | 3 +-- src/server/events/DisconnectAll.hpp | 2 +- src/server/events/Mark.cpp | 3 +-- 14 files changed, 21 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index c1e9efec..833ae0c6 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -21,6 +21,7 @@ #include #include +#include "ingen/types.hpp" #include "raul/Maid.hpp" #include "raul/Noncopyable.hpp" @@ -72,6 +73,11 @@ private: Task _master; }; +inline MPtr compile(Raul::Maid& maid, GraphImpl& graph) +{ + return CompiledGraph::compile(maid, graph); +} + } // namespace Server } // namespace Ingen diff --git a/src/server/PreProcessContext.hpp b/src/server/PreProcessContext.hpp index ee9bed86..1b57c013 100644 --- a/src/server/PreProcessContext.hpp +++ b/src/server/PreProcessContext.hpp @@ -64,7 +64,7 @@ public: */ MPtr maybe_compile(Raul::Maid& maid, GraphImpl& graph) { if (must_compile(graph)) { - return CompiledGraph::compile(maid, graph); + return compile(maid, graph); } return MPtr(); } diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index c75e56a1..85f8d30a 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -125,8 +125,7 @@ Connect::pre_process(PreProcessContext& ctx) } if (ctx.must_compile(*_graph)) { - if (!(_compiled_graph = CompiledGraph::compile( - *_engine.maid(), *_graph))) { + if (!(_compiled_graph = compile(*_engine.maid(), *_graph))) { head_block->providers().erase(tail_block); tail_block->dependants().erase(head_block); return Event::pre_process_done(Status::COMPILATION_FAILED); diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index 78c0befa..2493e899 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -19,6 +19,7 @@ #include "raul/Path.hpp" +#include "CompiledGraph.hpp" #include "Event.hpp" #include "PortImpl.hpp" #include "types.hpp" @@ -31,7 +32,6 @@ namespace Ingen { namespace Server { class ArcImpl; -class CompiledGraph; class GraphImpl; class InputPort; diff --git a/src/server/events/Copy.hpp b/src/server/events/Copy.hpp index e95d905e..52a82b67 100644 --- a/src/server/events/Copy.hpp +++ b/src/server/events/Copy.hpp @@ -22,13 +22,13 @@ #include "ingen/Store.hpp" #include "raul/Path.hpp" +#include "CompiledGraph.hpp" #include "Event.hpp" namespace Ingen { namespace Server { class BlockImpl; -class CompiledGraph; class GraphImpl; namespace Events { diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index 7ffd9931..bba25534 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -20,13 +20,13 @@ #include "ingen/Resource.hpp" #include "ClientUpdate.hpp" +#include "CompiledGraph.hpp" #include "Event.hpp" namespace Ingen { namespace Server { class BlockImpl; -class CompiledGraph; class GraphImpl; namespace Events { diff --git a/src/server/events/CreateGraph.hpp b/src/server/events/CreateGraph.hpp index 9b4124e4..9225ad9d 100644 --- a/src/server/events/CreateGraph.hpp +++ b/src/server/events/CreateGraph.hpp @@ -19,6 +19,7 @@ #include "ingen/Resource.hpp" +#include "CompiledGraph.hpp" #include "Event.hpp" #include "events/Get.hpp" @@ -26,7 +27,6 @@ namespace Ingen { namespace Server { class GraphImpl; -class CompiledGraph; namespace Events { diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index 224cad3b..0003e821 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -19,9 +19,10 @@ #include "ingen/Store.hpp" +#include "CompiledGraph.hpp" +#include "ControlBindings.hpp" #include "Event.hpp" #include "GraphImpl.hpp" -#include "ControlBindings.hpp" namespace Raul { template class Array; @@ -31,7 +32,6 @@ namespace Ingen { namespace Server { class BlockImpl; -class CompiledGraph; class DuplexPort; class EnginePort; class PortImpl; diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index ecc1830a..16fc5d37 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -351,8 +351,7 @@ Delta::pre_process(PreProcessContext& ctx) op = SpecialType::ENABLE; // FIXME: defer this until all other metadata has been processed if (value.get() && !_graph->enabled()) { - if (!(_compiled_graph = CompiledGraph::compile( - *_engine.maid(), *_graph))) { + if (!(_compiled_graph = compile(*_engine.maid(), *_graph))) { _status = Status::COMPILATION_FAILED; } } diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index 842986a9..40c65ef8 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -25,9 +25,10 @@ #include "raul/URI.hpp" -#include "PluginImpl.hpp" +#include "CompiledGraph.hpp" #include "ControlBindings.hpp" #include "Event.hpp" +#include "PluginImpl.hpp" namespace Ingen { @@ -35,7 +36,6 @@ class Resource; namespace Server { -class CompiledGraph; class Engine; class GraphImpl; class RunContext; diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index 3a7e0cff..984a1dd4 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -20,6 +20,7 @@ #include "raul/Path.hpp" #include "BufferFactory.hpp" +#include "CompiledGraph.hpp" #include "Event.hpp" #include "GraphImpl.hpp" #include "types.hpp" @@ -31,7 +32,6 @@ template class Array; namespace Ingen { namespace Server { -class CompiledGraph; class InputPort; class PortImpl; diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index dc9652d9..23f5118f 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -133,8 +133,7 @@ DisconnectAll::pre_process(PreProcessContext& ctx) } if (!_deleting && ctx.must_compile(*_parent)) { - if (!(_compiled_graph = CompiledGraph::compile( - *_engine.maid(), *_parent))) { + if (!(_compiled_graph = compile(*_engine.maid(), *_parent))) { return Event::pre_process_done(Status::COMPILATION_FAILED); } } diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index abfa0572..a8de6baf 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -21,6 +21,7 @@ #include "raul/Path.hpp" +#include "CompiledGraph.hpp" #include "Disconnect.hpp" #include "Event.hpp" @@ -28,7 +29,6 @@ namespace Ingen { namespace Server { class BlockImpl; -class CompiledGraph; class GraphImpl; class PortImpl; diff --git a/src/server/events/Mark.cpp b/src/server/events/Mark.cpp index eee2d552..abba85e8 100644 --- a/src/server/events/Mark.cpp +++ b/src/server/events/Mark.cpp @@ -54,8 +54,7 @@ Mark::pre_process(PreProcessContext& ctx) ctx.set_in_bundle(false); if (!ctx.dirty_graphs().empty()) { for (GraphImpl* g : ctx.dirty_graphs()) { - MPtr cg = CompiledGraph::compile( - *_engine.maid(), *g); + MPtr cg = compile(*_engine.maid(), *g); if (cg) { _compiled_graphs.insert(std::make_pair(g, std::move(cg))); } -- cgit v1.2.1