summaryrefslogtreecommitdiffstats
path: root/src/server/PreProcessContext.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/PreProcessContext.hpp')
-rw-r--r--src/server/PreProcessContext.hpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/server/PreProcessContext.hpp b/src/server/PreProcessContext.hpp
index 7579e1e2..7c97af3c 100644
--- a/src/server/PreProcessContext.hpp
+++ b/src/server/PreProcessContext.hpp
@@ -20,12 +20,10 @@
#include "CompiledGraph.hpp"
#include "GraphImpl.hpp"
+#include <memory>
#include <unordered_set>
-namespace Raul { class Maid; }
-
-namespace ingen {
-namespace server {
+namespace ingen::server {
/** Event pre-processing context.
*
@@ -50,12 +48,14 @@ public:
bool must_compile(GraphImpl& graph) {
if (!graph.enabled()) {
return false;
- } else if (_in_bundle) {
+ }
+
+ if (_in_bundle) {
_dirty_graphs.insert(&graph);
return false;
- } else {
- return true;
}
+
+ return true;
}
/** Compile graph and return the result if necessary.
@@ -63,11 +63,9 @@ public:
* This may return null when an atomic bundle is deferring compilation, in
* which case the graph is flagged as dirty for later compilation.
*/
- MPtr<CompiledGraph> maybe_compile(Raul::Maid& maid, GraphImpl& graph) {
- if (must_compile(graph)) {
- return compile(maid, graph);
- }
- return MPtr<CompiledGraph>();
+ [[nodiscard]] std::unique_ptr<CompiledGraph> maybe_compile(GraphImpl& graph)
+ {
+ return must_compile(graph) ? compile(graph) : nullptr;
}
/** Return all graphs that require compilation after an atomic bundle. */
@@ -79,7 +77,6 @@ private:
bool _in_bundle = false;
};
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server
#endif // INGEN_ENGINE_PREPROCESSCONTEXT_HPP