summaryrefslogtreecommitdiffstats
path: root/src/server/events/Delta.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/events/Delta.cpp')
-rw-r--r--src/server/events/Delta.cpp56
1 files changed, 26 insertions, 30 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 0b8cab39..cba21214 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -32,23 +32,24 @@
#include "PortType.hpp"
#include "SetPortValue.hpp"
-#include "ingen/Atom.hpp"
-#include "ingen/FilePath.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/Interface.hpp"
-#include "ingen/Log.hpp"
-#include "ingen/Message.hpp"
-#include "ingen/Node.hpp"
-#include "ingen/Status.hpp"
-#include "ingen/Store.hpp"
-#include "ingen/URIs.hpp"
-#include "ingen/World.hpp"
-#include "ingen/paths.hpp"
-#include "lilv/lilv.h"
-#include "raul/Maid.hpp"
-#include "raul/Path.hpp"
-
-#include <algorithm>
+#include <ingen/Atom.hpp>
+#include <ingen/FilePath.hpp>
+#include <ingen/Forge.hpp>
+#include <ingen/Interface.hpp>
+#include <ingen/Log.hpp>
+#include <ingen/Message.hpp>
+#include <ingen/Node.hpp>
+#include <ingen/Properties.hpp>
+#include <ingen/Resource.hpp>
+#include <ingen/Status.hpp>
+#include <ingen/Store.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <ingen/World.hpp>
+#include <ingen/paths.hpp>
+#include <lilv/lilv.h>
+#include <raul/Path.hpp>
+
#include <memory>
#include <mutex>
#include <set>
@@ -57,11 +58,7 @@
#include <utility>
#include <vector>
-namespace ingen::server {
-
-class PreProcessContext;
-
-namespace events {
+namespace ingen::server::events {
Delta::Delta(Engine& engine,
const std::shared_ptr<Interface>& client,
@@ -213,7 +210,7 @@ Delta::pre_process(PreProcessContext& ctx)
return Event::pre_process_done(Status::FAILURE);
}
- std::lock_guard<Store::Mutex> lock(_engine.store()->mutex());
+ const std::lock_guard<Store::Mutex> lock{_engine.store()->mutex()};
_object = is_graph_object
? static_cast<ingen::Resource*>(_engine.store()->get(uri_to_path(_subject)))
@@ -225,7 +222,7 @@ Delta::pre_process(PreProcessContext& ctx)
}
if (is_graph_object && !_object) {
- raul::Path path(uri_to_path(_subject));
+ const raul::Path path{uri_to_path(_subject)};
bool is_graph = false;
bool is_block = false;
@@ -318,8 +315,8 @@ Delta::pre_process(PreProcessContext& ctx)
const Property& value = p.second;
SpecialType op = SpecialType::NONE;
if (obj) {
- Resource& resource = *obj;
if (value != uris.patch_wildcard) {
+ Resource& resource = *obj;
if (resource.add_property(key, value, value.context())) {
_added.emplace(key, value);
}
@@ -397,7 +394,7 @@ Delta::pre_process(PreProcessContext& ctx)
op = SpecialType::ENABLE;
// FIXME: defer until all other data has been processed
if (value.get<int32_t>() && !_graph->enabled()) {
- if (!(_compiled_graph = compile(*_engine.maid(), *_graph))) {
+ if (!(_compiled_graph = compile(*_graph))) {
_status = Status::COMPILATION_FAILED;
}
}
@@ -516,7 +513,7 @@ Delta::execute(RunContext& ctx)
if (_graph) {
if (value.get<int32_t>()) {
if (_compiled_graph) {
- _graph->set_compiled_graph(std::move(_compiled_graph));
+ _compiled_graph = _graph->swap_compiled_graph(std::move(_compiled_graph));
}
_graph->enable();
} else {
@@ -594,7 +591,7 @@ Delta::post_process()
_state.reset();
}
- Broadcaster::Transfer t(*_engine.broadcaster());
+ const Broadcaster::Transfer t{*_engine.broadcaster()};
if (_create_event) {
_create_event->post_process();
@@ -673,5 +670,4 @@ Delta::get_execution() const
return _block ? Execution::ATOMIC : Execution::NORMAL;
}
-} // namespace events
-} // namespace ingen::server
+} // namespace ingen::server::events