Commit c4e5343e authored by Jakob Otto's avatar Jakob Otto

Refactor packet_writer_impl

parent e8ca5421
......@@ -42,7 +42,7 @@ public:
// Following buffers are one or more payload buffers for this packet.
/// @warning takes ownership of `buffers`.
template <class... Ts>
void write_packet(Ts... buffers) {
void write_packet(Ts&... buffers) {
buffer_type* bufs[] = {&buffers...};
write_impl(make_span(bufs, sizeof...(Ts)));
}
......
......@@ -68,13 +68,6 @@ public:
// -- member functions -------------------------------------------------------
template <class... Ts>
void write_packet(span<const byte> header, span<const byte> payload,
Ts&&... xs) {
parent_.write_packet(header, payload, std::forward<Ts>(xs)...,
object_.id());
}
void cancel_timeout(atom_value type, uint64_t id) {
parent_.cancel_timeout(type, id);
}
......@@ -85,9 +78,8 @@ public:
}
protected:
// TODO: this should replace the current `write_packet()`
void write_impl(span<buffer_type*>) override {
// parent_.write_packet(buffers);
void write_impl(span<buffer_type*> buffers) override {
parent_.write_packet(object_.id(), buffers);
}
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment