summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ingen/AtomWriter.hpp5
-rw-r--r--ingen/Interface.hpp53
-rw-r--r--ingen/Message.hpp15
-rw-r--r--ingen/Tee.hpp7
-rw-r--r--ingen/client/ClientStore.hpp2
-rw-r--r--ingen/client/SigClientInterface.hpp2
-rw-r--r--src/AtomReader.cpp48
-rw-r--r--src/AtomWriter.cpp52
-rw-r--r--src/gui/App.cpp2
-rw-r--r--src/server/Broadcaster.hpp2
-rw-r--r--src/server/EventWriter.cpp43
-rw-r--r--src/server/EventWriter.hpp3
-rw-r--r--tests/TestClient.hpp2
13 files changed, 114 insertions, 122 deletions
diff --git a/ingen/AtomWriter.hpp b/ingen/AtomWriter.hpp
index 21fcb933..20d152e6 100644
--- a/ingen/AtomWriter.hpp
+++ b/ingen/AtomWriter.hpp
@@ -42,8 +42,6 @@ public:
return Raul::URI("ingen:/clients/atom_writer");
}
- void set_response_id(int32_t id);
-
void message(const Message& message) override;
void operator()(const BundleBegin&);
@@ -67,7 +65,7 @@ private:
void forge_uri(const Raul::URI& uri);
void forge_properties(const Properties& properties);
void forge_arc(const Raul::Path& tail, const Raul::Path& head);
- void forge_request(LV2_Atom_Forge_Frame* frame, LV2_URID type);
+ void forge_request(LV2_Atom_Forge_Frame* frame, LV2_URID type, int32_t id);
void forge_context(Resource::Graph ctx);
void finish_msg();
@@ -77,7 +75,6 @@ private:
AtomSink& _sink;
AtomForgeSink _out;
LV2_Atom_Forge _forge;
- int32_t _id;
};
} // namespace Ingen
diff --git a/ingen/Interface.hpp b/ingen/Interface.hpp
index 68f21304..a516892c 100644
--- a/ingen/Interface.hpp
+++ b/ingen/Interface.hpp
@@ -21,6 +21,7 @@
#ifndef INGEN_INTERFACE_HPP
#define INGEN_INTERFACE_HPP
+#include <cstdint>
#include <string>
#include "ingen/Message.hpp"
@@ -44,7 +45,9 @@ namespace Ingen {
class INGEN_API Interface
{
public:
- virtual ~Interface() {}
+ Interface() : _seq(0) {}
+
+ virtual ~Interface() = default;
virtual Raul::URI uri() const = 0;
@@ -54,22 +57,27 @@ public:
virtual void set_respondee(SPtr<Interface> respondee) {}
- /** Set the ID to use to respond to the next message.
- * Setting the ID to 0 will disable responses.
+ virtual void message(const Message& msg) = 0;
+
+ /** @name Convenience API
+ * @{
*/
- virtual void set_response_id(int32_t id) = 0;
- virtual void message(const Message& message) = 0;
+ inline void operator()(const Message& msg) { message(msg); }
+
+ inline void set_response_id(int32_t id) {
+ _seq = id;
+ }
- inline void bundle_begin() { message(BundleBegin{}); }
+ inline void bundle_begin() { message(BundleBegin{_seq++}); }
- inline void bundle_end() { message(BundleEnd{}); }
+ inline void bundle_end() { message(BundleEnd{_seq++}); }
inline void put(const Raul::URI& uri,
const Properties& properties,
Resource::Graph ctx = Resource::Graph::DEFAULT)
{
- message(Put{uri, properties, ctx});
+ message(Put{_seq++, uri, properties, ctx});
}
inline void delta(const Raul::URI& uri,
@@ -77,34 +85,34 @@ public:
const Properties& add,
Resource::Graph ctx = Resource::Graph::DEFAULT)
{
- message(Delta{uri, remove, add, ctx});
+ message(Delta{_seq++, uri, remove, add, ctx});
}
inline void copy(const Raul::URI& old_uri, const Raul::URI& new_uri)
{
- message(Copy{old_uri, new_uri});
+ message(Copy{_seq++, old_uri, new_uri});
}
inline void move(const Raul::Path& old_path, const Raul::Path& new_path)
{
- message(Move{old_path, new_path});
+ message(Move{_seq++, old_path, new_path});
}
- inline void del(const Raul::URI& uri) { message(Del{uri}); }
+ inline void del(const Raul::URI& uri) { message(Del{_seq++, uri}); }
inline void connect(const Raul::Path& tail, const Raul::Path& head)
{
- message(Connect{tail, head});
+ message(Connect{_seq++, tail, head});
}
inline void disconnect(const Raul::Path& tail, const Raul::Path& head)
{
- message(Disconnect{tail, head});
+ message(Disconnect{_seq++, tail, head});
}
inline void disconnect_all(const Raul::Path& graph, const Raul::Path& path)
{
- message(DisconnectAll{graph, path});
+ message(DisconnectAll{_seq++, graph, path});
}
inline void set_property(const Raul::URI& subject,
@@ -112,14 +120,14 @@ public:
const Atom& value,
Resource::Graph ctx = Resource::Graph::DEFAULT)
{
- message(SetProperty{subject, predicate, value, ctx});
+ message(SetProperty{_seq++, subject, predicate, value, ctx});
}
- inline void undo() { message(Undo{}); }
+ inline void undo() { message(Undo{_seq++}); }
- inline void redo() { message(Redo{}); }
+ inline void redo() { message(Redo{_seq++}); }
- inline void get(const Raul::URI& uri) { message(Get{uri}); }
+ inline void get(const Raul::URI& uri) { message(Get{_seq++, uri}); }
inline void response(int32_t id,
Status status,
@@ -128,8 +136,13 @@ public:
}
inline void error(const std::string& error_message) {
- message(Error{error_message});
+ message(Error{_seq++, error_message});
}
+
+ /** @} */
+
+private:
+ int32_t _seq;
};
} // namespace Ingen
diff --git a/ingen/Message.hpp b/ingen/Message.hpp
index d4118dcb..fd5231ad 100644
--- a/ingen/Message.hpp
+++ b/ingen/Message.hpp
@@ -37,31 +37,37 @@ namespace Ingen {
struct BundleBegin
{
+ int32_t seq;
};
struct BundleEnd
{
+ int32_t seq;
};
struct Connect
{
+ int32_t seq;
Raul::Path tail;
Raul::Path head;
};
struct Copy
{
+ int32_t seq;
Raul::URI old_uri;
Raul::URI new_uri;
};
struct Del
{
+ int32_t seq;
Raul::URI uri;
};
struct Delta
{
+ int32_t seq;
Raul::URI uri;
Properties remove;
Properties add;
@@ -70,34 +76,40 @@ struct Delta
struct Disconnect
{
+ int32_t seq;
Raul::Path tail;
Raul::Path head;
};
struct DisconnectAll
{
+ int32_t seq;
Raul::Path graph;
Raul::Path path;
};
struct Error
{
+ int32_t seq;
std::string message;
};
struct Get
{
+ int32_t seq;
Raul::URI subject;
};
struct Move
{
+ int32_t seq;
Raul::Path old_path;
Raul::Path new_path;
};
struct Put
{
+ int32_t seq;
Raul::URI uri;
Properties properties;
Resource::Graph ctx;
@@ -105,6 +117,7 @@ struct Put
struct Redo
{
+ int32_t seq;
};
struct Response
@@ -116,6 +129,7 @@ struct Response
struct SetProperty
{
+ int32_t seq;
Raul::URI subject;
Raul::URI predicate;
Atom value;
@@ -124,6 +138,7 @@ struct SetProperty
struct Undo
{
+ int32_t seq;
};
using Message = boost::variant<BundleBegin,
diff --git a/ingen/Tee.hpp b/ingen/Tee.hpp
index 12cccc91..f02d8602 100644
--- a/ingen/Tee.hpp
+++ b/ingen/Tee.hpp
@@ -54,13 +54,6 @@ public:
(*_sinks.begin())->set_respondee(respondee);
}
- void set_response_id(int32_t id) {
- std::lock_guard<std::mutex> lock(_sinks_mutex);
- for (const auto& s : _sinks) {
- s->set_response_id(id);
- }
- }
-
void message(const Message& message) override {
std::lock_guard<std::mutex> lock(_sinks_mutex);
for (const auto& s : _sinks) {
diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp
index 899273dc..2724df9a 100644
--- a/ingen/client/ClientStore.hpp
+++ b/ingen/client/ClientStore.hpp
@@ -92,8 +92,6 @@ public:
void operator()(const SetProperty&);
void operator()(const Undo&) {}
- void set_response_id(int32_t id) {}
-
INGEN_SIGNAL(new_object, void, SPtr<ObjectModel>);
INGEN_SIGNAL(new_plugin, void, SPtr<PluginModel>);
INGEN_SIGNAL(plugin_deleted, void, Raul::URI);
diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp
index 2934e8b1..04af2dd9 100644
--- a/ingen/client/SigClientInterface.hpp
+++ b/ingen/client/SigClientInterface.hpp
@@ -54,8 +54,6 @@ public:
virtual bool emit_signals() { return false; }
protected:
- void set_response_id(int32_t id) {}
-
void message(const Message& msg) override {
_signal_message(msg);
}
diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp
index 40be80e2..eb5b957b 100644
--- a/src/AtomReader.cpp
+++ b/src/AtomReader.cpp
@@ -158,25 +158,24 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
const boost::optional<Raul::URI> subject_uri = atom_to_uri(subject);
- const int32_t seq_id = ((number && number->type == _uris.atom_Int)
- ? ((const LV2_Atom_Int*)number)->body
- : default_id);
- _iface.set_response_id(seq_id);
+ const int32_t seq = ((number && number->type == _uris.atom_Int)
+ ? ((const LV2_Atom_Int*)number)->body
+ : default_id);
if (obj->body.otype == _uris.patch_Get) {
if (subject_uri) {
- _iface.get(*subject_uri);
+ _iface(Get{seq, *subject_uri});
}
} else if (obj->body.otype == _uris.ingen_BundleStart) {
- _iface.bundle_begin();
+ _iface(BundleBegin{seq});
} else if (obj->body.otype == _uris.ingen_BundleEnd) {
- _iface.bundle_end();
+ _iface(BundleEnd{seq});
} else if (obj->body.otype == _uris.patch_Delete) {
const LV2_Atom_Object* body = NULL;
lv2_atom_object_get(obj, (LV2_URID)_uris.patch_body, &body, 0);
if (subject_uri && !body) {
- _iface.del(*subject_uri);
+ _iface(Del{seq, *subject_uri});
return true;
} else if (body && body->body.otype == _uris.ingen_Arc) {
const LV2_Atom* tail = NULL;
@@ -193,9 +192,9 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
boost::optional<Raul::Path> head_path(atom_to_path(head));
boost::optional<Raul::Path> other_path(atom_to_path(incidentTo));
if (tail_path && head_path) {
- _iface.disconnect(*tail_path, *head_path);
+ _iface(Disconnect{seq, *tail_path, *head_path});
} else if (subject_path && other_path) {
- _iface.disconnect_all(*subject_path, *other_path);
+ _iface(DisconnectAll{seq, *subject_path, *other_path});
} else {
_log.warn("Delete of unknown object\n");
return false;
@@ -231,14 +230,14 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
boost::optional<Raul::Path> tail_path(atom_to_path(tail));
boost::optional<Raul::Path> head_path(atom_to_path(head));
if (tail_path && head_path) {
- _iface.connect(*tail_path, *head_path);
+ _iface(Connect{seq, *tail_path, *head_path});
} else {
_log.warn("Arc has non-path tail or head\n");
}
} else {
Ingen::Properties props;
get_props(body, props);
- _iface.put(*subject_uri, props, atom_to_context(context));
+ _iface(Put{seq, *subject_uri, props, atom_to_context(context)});
}
} else if (obj->body.otype == _uris.patch_Set) {
if (!subject_uri) {
@@ -264,10 +263,11 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
Atom atom;
get_atom(value, atom);
- _iface.set_property(*subject_uri,
- Raul::URI(_map.unmap_uri(prop->body)),
- atom,
- atom_to_context(context));
+ _iface(SetProperty{seq,
+ *subject_uri,
+ Raul::URI(_map.unmap_uri(prop->body)),
+ atom,
+ atom_to_context(context)});
} else if (obj->body.otype == _uris.patch_Patch) {
if (!subject_uri) {
_log.warn("Patch message has no subject\n");
@@ -296,8 +296,8 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
Ingen::Properties remove_props;
get_props(remove, remove_props);
- _iface.delta(*subject_uri, remove_props, add_props,
- atom_to_context(context));
+ _iface(Delta{seq, *subject_uri, remove_props, add_props,
+ atom_to_context(context)});
} else if (obj->body.otype == _uris.patch_Copy) {
if (!subject) {
_log.warn("Copy message has no subject\n");
@@ -323,7 +323,7 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
return false;
}
- _iface.copy(*subject_uri, *dest_uri);
+ _iface(Copy{seq, *subject_uri, *dest_uri});
} else if (obj->body.otype == _uris.patch_Move) {
if (!subject) {
_log.warn("Move message has no subject\n");
@@ -349,7 +349,7 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
return false;
}
- _iface.move(*subject_path, *dest_path);
+ _iface(Move{seq, *subject_path, *dest_path});
} else if (obj->body.otype == _uris.patch_Response) {
const LV2_Atom* seq = NULL;
const LV2_Atom* body = NULL;
@@ -364,13 +364,13 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
_log.warn("Response message body is not integer\n");
return false;
}
- _iface.response(((const LV2_Atom_Int*)seq)->body,
+ _iface(Response{((const LV2_Atom_Int*)seq)->body,
(Ingen::Status)((const LV2_Atom_Int*)body)->body,
- subject_uri ? subject_uri->c_str() : "");
+ subject_uri ? subject_uri->c_str() : ""});
} else if (obj->body.otype == _uris.ingen_BundleStart) {
- _iface.bundle_begin();
+ _iface(BundleBegin{seq});
} else if (obj->body.otype == _uris.ingen_BundleEnd) {
- _iface.bundle_end();
+ _iface(BundleEnd{seq});
} else {
_log.warn(fmt("Unknown object type <%1%>\n")
% _map.unmap_uri(obj->body.otype));
diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp
index 1615630f..cf5f40ac 100644
--- a/src/AtomWriter.cpp
+++ b/src/AtomWriter.cpp
@@ -66,7 +66,6 @@ AtomWriter::AtomWriter(URIMap& map, URIs& uris, AtomSink& sink)
: _map(map)
, _uris(uris)
, _sink(sink)
- , _id(0)
{
lv2_atom_forge_init(&_forge, &map.urid_map_feature()->urid_map);
_out.set_forge_sink(&_forge);
@@ -109,19 +108,19 @@ AtomWriter::message(const Message& message)
* @endcode
*/
void
-AtomWriter::operator()(const BundleBegin&)
+AtomWriter::operator()(const BundleBegin& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.ingen_BundleStart);
+ forge_request(&msg, _uris.ingen_BundleStart, message.seq);
lv2_atom_forge_pop(&_forge, &msg);
finish_msg();
}
void
-AtomWriter::operator()(const BundleEnd&)
+AtomWriter::operator()(const BundleEnd& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.ingen_BundleEnd);
+ forge_request(&msg, _uris.ingen_BundleEnd, message.seq);
lv2_atom_forge_pop(&_forge, &msg);
finish_msg();
}
@@ -163,13 +162,13 @@ AtomWriter::forge_arc(const Raul::Path& tail, const Raul::Path& head)
}
void
-AtomWriter::forge_request(LV2_Atom_Forge_Frame* frame, LV2_URID type)
+AtomWriter::forge_request(LV2_Atom_Forge_Frame* frame, LV2_URID type, int32_t id)
{
lv2_atom_forge_object(&_forge, frame, 0, type);
- if (_id) {
+ if (id) {
lv2_atom_forge_key(&_forge, _uris.patch_sequenceNumber);
- lv2_atom_forge_int(&_forge, _id);
+ lv2_atom_forge_int(&_forge, id);
}
}
@@ -217,7 +216,7 @@ void
AtomWriter::operator()(const Put& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Put);
+ forge_request(&msg, _uris.patch_Put, message.seq);
forge_context(message.ctx);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(message.uri);
@@ -262,7 +261,7 @@ void
AtomWriter::operator()(const Delta& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Patch);
+ forge_request(&msg, _uris.patch_Patch, message.seq);
forge_context(message.ctx);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(message.uri);
@@ -310,7 +309,7 @@ void
AtomWriter::operator()(const Copy& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Copy);
+ forge_request(&msg, _uris.patch_Copy, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(message.old_uri);
lv2_atom_forge_key(&_forge, _uris.patch_destination);
@@ -339,7 +338,7 @@ void
AtomWriter::operator()(const Move& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Move);
+ forge_request(&msg, _uris.patch_Move, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(path_to_uri(message.old_path));
lv2_atom_forge_key(&_forge, _uris.patch_destination);
@@ -367,7 +366,7 @@ void
AtomWriter::operator()(const Del& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Delete);
+ forge_request(&msg, _uris.patch_Delete, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(message.uri);
lv2_atom_forge_pop(&_forge, &msg);
@@ -392,7 +391,7 @@ void
AtomWriter::operator()(const SetProperty& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Set);
+ forge_request(&msg, _uris.patch_Set, message.seq);
forge_context(message.ctx);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(message.subject);
@@ -419,10 +418,10 @@ AtomWriter::operator()(const SetProperty& message)
* @endcode
*/
void
-AtomWriter::operator()(const Undo&)
+AtomWriter::operator()(const Undo& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.ingen_Undo);
+ forge_request(&msg, _uris.ingen_Undo, message.seq);
lv2_atom_forge_pop(&_forge, &msg);
finish_msg();
}
@@ -437,10 +436,10 @@ AtomWriter::operator()(const Undo&)
* @endcode
*/
void
-AtomWriter::operator()(const Redo&)
+AtomWriter::operator()(const Redo& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.ingen_Redo);
+ forge_request(&msg, _uris.ingen_Redo, message.seq);
lv2_atom_forge_pop(&_forge, &msg);
finish_msg();
}
@@ -461,7 +460,7 @@ void
AtomWriter::operator()(const Get& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Get);
+ forge_request(&msg, _uris.patch_Get, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(message.subject);
lv2_atom_forge_pop(&_forge, &msg);
@@ -495,7 +494,7 @@ void
AtomWriter::operator()(const Connect& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Put);
+ forge_request(&msg, _uris.patch_Put, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(path_to_uri(Raul::Path::lca(message.tail, message.head)));
lv2_atom_forge_key(&_forge, _uris.patch_body);
@@ -524,7 +523,7 @@ void
AtomWriter::operator()(const Disconnect& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Delete);
+ forge_request(&msg, _uris.patch_Delete, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_body);
forge_arc(message.tail, message.head);
lv2_atom_forge_pop(&_forge, &msg);
@@ -553,7 +552,7 @@ void
AtomWriter::operator()(const DisconnectAll& message)
{
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Delete);
+ forge_request(&msg, _uris.patch_Delete, message.seq);
lv2_atom_forge_key(&_forge, _uris.patch_subject);
forge_uri(path_to_uri(message.graph));
@@ -569,13 +568,6 @@ AtomWriter::operator()(const DisconnectAll& message)
finish_msg();
}
-void
-AtomWriter::set_response_id(int32_t id)
-{
- _id = id;
-}
-
-
/** @page protocol
* @section Responses
*
@@ -615,7 +607,7 @@ AtomWriter::operator()(const Response& response)
}
LV2_Atom_Forge_Frame msg;
- forge_request(&msg, _uris.patch_Response);
+ forge_request(&msg, _uris.patch_Response, 0);
lv2_atom_forge_key(&_forge, _uris.patch_sequenceNumber);
lv2_atom_forge_int(&_forge, response.id);
if (!subject.empty() && Raul::URI::is_valid(subject)) {
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 789ead6d..c0f3f9bd 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -263,7 +263,7 @@ App::set_property(const Raul::URI& subject,
went as planned here and fire the signal ourselves as if the server
feedback came back immediately. */
if (key != uris().ingen_activity) {
- _client->signal_message().emit(SetProperty{subject, key, value, ctx});
+ _client->signal_message().emit(SetProperty{0, subject, key, value, ctx});
}
}
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:
diff --git a/tests/TestClient.hpp b/tests/TestClient.hpp
index 90fc212b..317ecd97 100644
--- a/tests/TestClient.hpp
+++ b/tests/TestClient.hpp
@@ -31,8 +31,6 @@ public:
Raul::URI uri() const { return Raul::URI("ingen:testClient"); }
- void set_response_id(int32_t id) override {}
-
void message(const Message& msg) override {
if (const Response* const response = boost::get<Response>(&msg)) {
if (response->status != Status::SUCCESS) {