summaryrefslogtreecommitdiffstats
path: root/src/server/events/Disconnect.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/events/Disconnect.hpp')
-rw-r--r--src/server/events/Disconnect.hpp52
1 files changed, 33 insertions, 19 deletions
diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp
index ec638c73..92dd81d3 100644
--- a/src/server/events/Disconnect.hpp
+++ b/src/server/events/Disconnect.hpp
@@ -17,16 +17,27 @@
#ifndef INGEN_EVENTS_DISCONNECT_HPP
#define INGEN_EVENTS_DISCONNECT_HPP
-#include "CompiledGraph.hpp"
#include "Event.hpp"
#include "PortImpl.hpp"
#include "types.hpp"
+#include <ingen/Message.hpp>
+#include <raul/Maid.hpp>
+
+#include <memory>
+
namespace ingen {
+
+class Interface;
+
namespace server {
class ArcImpl;
+class CompiledGraph;
+class Engine;
+class GraphImpl;
class InputPort;
+class RunContext;
namespace events {
@@ -37,38 +48,41 @@ namespace events {
class Disconnect : public Event
{
public:
- Disconnect(Engine& engine,
- const SPtr<Interface>& client,
- SampleCount timestamp,
- const ingen::Disconnect& msg);
+ Disconnect(Engine& engine,
+ const std::shared_ptr<Interface>& client,
+ SampleCount timestamp,
+ const ingen::Disconnect& msg);
+
+ ~Disconnect() override;
bool pre_process(PreProcessContext& ctx) override;
- void execute(RunContext& context) override;
+ void execute(RunContext& ctx) override;
void post_process() override;
void undo(Interface& target) override;
- class Impl {
+ class Impl
+ {
public:
Impl(Engine& e, GraphImpl* graph, PortImpl* t, InputPort* h);
- bool execute(RunContext& context, bool set_head_buffers);
+ bool execute(RunContext& ctx, bool set_head_buffers);
- inline PortImpl* tail() { return _tail; }
- inline InputPort* head() { return _head; }
+ PortImpl* tail() { return _tail; }
+ InputPort* head() { return _head; }
private:
- Engine& _engine;
- PortImpl* _tail;
- InputPort* _head;
- SPtr<ArcImpl> _arc;
- MPtr<PortImpl::Voices> _voices;
+ Engine& _engine;
+ PortImpl* _tail;
+ InputPort* _head;
+ std::shared_ptr<ArcImpl> _arc;
+ raul::managed_ptr<PortImpl::Voices> _voices;
};
private:
- const ingen::Disconnect _msg;
- GraphImpl* _graph;
- UPtr<Impl> _impl;
- MPtr<CompiledGraph> _compiled_graph;
+ const ingen::Disconnect _msg;
+ GraphImpl* _graph{nullptr};
+ std::unique_ptr<Impl> _impl;
+ std::unique_ptr<CompiledGraph> _compiled_graph;
};
} // namespace events