Commit 6b8c87b0 authored by Jakob Otto's avatar Jakob Otto

Refactor packet_writer_impl

parent 389ae820
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
// Following buffers are one or more payload buffers for this packet. // Following buffers are one or more payload buffers for this packet.
/// @warning takes ownership of `buffers`. /// @warning takes ownership of `buffers`.
template <class... Ts> template <class... Ts>
void write_packet(Ts... buffers) { void write_packet(Ts&... buffers) {
buffer_type* bufs[] = {&buffers...}; buffer_type* bufs[] = {&buffers...};
write_impl(make_span(bufs, sizeof...(Ts))); write_impl(make_span(bufs, sizeof...(Ts)));
} }
......
...@@ -68,13 +68,6 @@ public: ...@@ -68,13 +68,6 @@ public:
// -- member functions ------------------------------------------------------- // -- 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) { void cancel_timeout(atom_value type, uint64_t id) {
parent_.cancel_timeout(type, id); parent_.cancel_timeout(type, id);
} }
...@@ -85,9 +78,8 @@ public: ...@@ -85,9 +78,8 @@ public:
} }
protected: protected:
// TODO: this should replace the current `write_packet()` void write_impl(span<buffer_type*> buffers) override {
void write_impl(span<buffer_type*>) override { parent_.write_packet(object_.id(), buffers);
// parent_.write_packet(buffers);
} }
private: 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