summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-16 22:31:10 +0100
committerDavid Robillard <d@drobilla.net>2017-12-16 22:31:10 +0100
commit68901d7caa0636895de593e0b23cdec4fb53deaa (patch)
tree79fbfd567f2cc2b29ab225cec674127acb4d54d4 /src/server
parentf2d3c77c9a470f20506c90098ab5cf4d3e5c9eff (diff)
downloadingen-68901d7caa0636895de593e0b23cdec4fb53deaa.tar.gz
ingen-68901d7caa0636895de593e0b23cdec4fb53deaa.tar.bz2
ingen-68901d7caa0636895de593e0b23cdec4fb53deaa.zip
Move sequence numbers into messages and simplify interfaces
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Broadcaster.hpp2
-rw-r--r--src/server/EventWriter.cpp43
-rw-r--r--src/server/EventWriter.hpp3
3 files changed, 18 insertions, 30 deletions
diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp
index 6fcb3e4d..93b6ec8f 100644
--- a/src/server/Broadcaster.hpp
+++ b/src/server/Broadcaster.hpp
@@ -99,8 +99,6 @@ public:
Raul::URI uri() const { return Raul::URI("ingen:/broadcaster"); }
- void set_response_id(int32_t id) {} ///< N/A
-
private:
friend class Transfer;
diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp
index 2fc15802..7cec07bc 100644
--- a/src/server/EventWriter.cpp
+++ b/src/server/EventWriter.cpp
@@ -29,7 +29,6 @@ namespace Server {
EventWriter::EventWriter(Engine& engine)
: _engine(engine)
- , _request_id(0)
, _event_mode(Event::Mode::NORMAL)
{
}
@@ -41,31 +40,25 @@ EventWriter::now() const
}
void
-EventWriter::set_response_id(int32_t id)
-{
- _request_id = id;
-}
-
-void
EventWriter::message(const Message& msg)
{
boost::apply_visitor(*this, msg);
}
void
-EventWriter::operator()(const BundleBegin&)
+EventWriter::operator()(const BundleBegin& msg)
{
_engine.enqueue_event(
- new Events::Mark(_engine, _respondee, _request_id, now(),
+ new Events::Mark(_engine, _respondee, msg.seq, now(),
Events::Mark::Type::BUNDLE_START),
_event_mode);
}
void
-EventWriter::operator()(const BundleEnd&)
+EventWriter::operator()(const BundleEnd& msg)
{
_engine.enqueue_event(
- new Events::Mark(_engine, _respondee, _request_id, now(),
+ new Events::Mark(_engine, _respondee, msg.seq, now(),
Events::Mark::Type::BUNDLE_END),
_event_mode);
}
@@ -74,7 +67,7 @@ void
EventWriter::operator()(const Put& msg)
{
_engine.enqueue_event(
- new Events::Delta(_engine, _respondee, _request_id, now(),
+ new Events::Delta(_engine, _respondee, msg.seq, now(),
Events::Delta::Type::PUT, msg.ctx, msg.uri, msg.properties),
_event_mode);
}
@@ -83,7 +76,7 @@ void
EventWriter::operator()(const Delta& msg)
{
_engine.enqueue_event(
- new Events::Delta(_engine, _respondee, _request_id, now(),
+ new Events::Delta(_engine, _respondee, msg.seq, now(),
Events::Delta::Type::PATCH, msg.ctx, msg.uri, msg.add, msg.remove),
_event_mode);
}
@@ -92,7 +85,7 @@ void
EventWriter::operator()(const Copy& msg)
{
_engine.enqueue_event(
- new Events::Copy(_engine, _respondee, _request_id, now(),
+ new Events::Copy(_engine, _respondee, msg.seq, now(),
msg.old_uri, msg.new_uri),
_event_mode);
}
@@ -101,7 +94,7 @@ void
EventWriter::operator()(const Move& msg)
{
_engine.enqueue_event(
- new Events::Move(_engine, _respondee, _request_id, now(),
+ new Events::Move(_engine, _respondee, msg.seq, now(),
msg.old_path, msg.new_path),
_event_mode);
}
@@ -110,7 +103,7 @@ void
EventWriter::operator()(const Del& msg)
{
_engine.enqueue_event(
- new Events::Delete(_engine, _respondee, _request_id, now(), msg.uri),
+ new Events::Delete(_engine, _respondee, msg.seq, now(), msg.uri),
_event_mode);
}
@@ -118,7 +111,7 @@ void
EventWriter::operator()(const Connect& msg)
{
_engine.enqueue_event(
- new Events::Connect(_engine, _respondee, _request_id, now(),
+ new Events::Connect(_engine, _respondee, msg.seq, now(),
msg.tail, msg.head),
_event_mode);
@@ -128,7 +121,7 @@ void
EventWriter::operator()(const Disconnect& msg)
{
_engine.enqueue_event(
- new Events::Disconnect(_engine, _respondee, _request_id, now(),
+ new Events::Disconnect(_engine, _respondee, msg.seq, now(),
msg.tail, msg.head),
_event_mode);
}
@@ -137,7 +130,7 @@ void
EventWriter::operator()(const DisconnectAll& msg)
{
_engine.enqueue_event(
- new Events::DisconnectAll(_engine, _respondee, _request_id, now(),
+ new Events::DisconnectAll(_engine, _respondee, msg.seq, now(),
msg.graph, msg.path),
_event_mode);
}
@@ -146,25 +139,25 @@ void
EventWriter::operator()(const SetProperty& msg)
{
_engine.enqueue_event(
- new Events::Delta(_engine, _respondee, _request_id, now(),
+ new Events::Delta(_engine, _respondee, msg.seq, now(),
Events::Delta::Type::SET, msg.ctx,
msg.subject, {{msg.predicate, msg.value}}, {}),
_event_mode);
}
void
-EventWriter::operator()(const Undo&)
+EventWriter::operator()(const Undo& msg)
{
_engine.enqueue_event(
- new Events::Undo(_engine, _respondee, _request_id, now(), false),
+ new Events::Undo(_engine, _respondee, msg.seq, now(), false),
_event_mode);
}
void
-EventWriter::operator()(const Redo&)
+EventWriter::operator()(const Redo& msg)
{
_engine.enqueue_event(
- new Events::Undo(_engine, _respondee, _request_id, now(), true),
+ new Events::Undo(_engine, _respondee, msg.seq, now(), true),
_event_mode);
}
@@ -172,7 +165,7 @@ void
EventWriter::operator()(const Get& msg)
{
_engine.enqueue_event(
- new Events::Get(_engine, _respondee, _request_id, now(), msg.subject),
+ new Events::Get(_engine, _respondee, msg.seq, now(), msg.subject),
_event_mode);
}
diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp
index 4e8eaa4c..74c27b27 100644
--- a/src/server/EventWriter.hpp
+++ b/src/server/EventWriter.hpp
@@ -50,8 +50,6 @@ public:
_respondee = respondee;
}
- virtual void set_response_id(int32_t id);
-
void message(const Message& msg) override;
void set_event_mode(Event::Mode mode) { _event_mode = mode; }
@@ -77,7 +75,6 @@ public:
protected:
Engine& _engine;
SPtr<Interface> _respondee;
- int32_t _request_id;
Event::Mode _event_mode;
private: