diff options
author | Claudius 'keldu' Holeksa <mail@keldu.de> | 2024-07-24 11:09:55 +0200 |
---|---|---|
committer | Claudius 'keldu' Holeksa <mail@keldu.de> | 2024-07-24 11:09:55 +0200 |
commit | ea306799624d0390074f6afa5d38644cce076c9f (patch) | |
tree | 81563442aa083b8293f382017cf8d78984e527eb /modules/io_codec/c++/io_peer.tmpl.hpp | |
parent | 977ac8bce989285eaabc76c4ed8571ce5fd6793a (diff) |
wip
Diffstat (limited to 'modules/io_codec/c++/io_peer.tmpl.hpp')
-rw-r--r-- | modules/io_codec/c++/io_peer.tmpl.hpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/modules/io_codec/c++/io_peer.tmpl.hpp b/modules/io_codec/c++/io_peer.tmpl.hpp index d9dfe04..b7ccb49 100644 --- a/modules/io_codec/c++/io_peer.tmpl.hpp +++ b/modules/io_codec/c++/io_peer.tmpl.hpp @@ -1,20 +1,20 @@ namespace saw { -template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename BufferT> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, BufferT>:: streaming_io_peer( - own<conveyor_feeder<data<Incoming, Encoding>>> feed, + own<conveyor_feeder<data<Incoming, ContentEncoding>>> feed, own<async_io_stream> str) : streaming_io_peer{std::move(feed), std::move(str), {}, {}, {}, {}} {} -template <typename Incoming, typename Outgoing, typename TransportEncoding, ContentEncoding, typename BufferT> +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename BufferT> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, BufferT>:: streaming_io_peer( - own<conveyor_feeder<data<Incoming, Encoding>>> feed, - own<async_io_stream> stream, codec<Incoming, Encoding> in_codec, codec<Outgoing, Encoding> out_codec, BufferT in, BufferT out) + own<conveyor_feeder<data<Incoming, ContentEncoding>>> feed, + own<async_io_stream> stream, codec<Incoming, TransportEncoding> in_codec, codec<Outgoing, TransportEncoding> out_codec, BufferT in, BufferT out) : incoming_feeder_{std::move(feed)}, io_stream_{std::move(stream)}, in_codec_{std::move(in_codec)}, @@ -34,7 +34,7 @@ streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, while (true) { buffer_view in_view{in_buffer_}; - auto in_data = data<Incoming, Encoding>{in_view}; + auto in_data = data<Incoming, TransportEncoding>{in_view}; incoming_feeder_->feed(std::move(in_data)); } @@ -61,14 +61,14 @@ streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, io_stream_->read(&in_buffer_.write(), 1, in_buffer_.write_segment_length()); } -template <typename Incoming, typename Outgoing, - typename Encoding, typename BufferT> -error_or<void> streaming_io_peer<Incoming, Outgoing, Encoding, - BufferT>::send(data<Outgoing> +template <typename Incoming, typename Outgoing, typename TransportEncoding, + typename ContentEncoding, typename BufferT> +error_or<void> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, + BufferT>::send(data<Outgoing, ContentEncoding> msg) { bool restart_write = out_buffer_.read_segment_length() == 0; - data<Outgoing, Encoding> enc; + data<Outgoing, TransportEncoding> enc; auto eov = out_codec_.encode(msg, enc);//msg.read(), out_buffer_); @@ -84,22 +84,22 @@ error_or<void> streaming_io_peer<Incoming, Outgoing, Encoding, return void_t{}; } -template <typename Incoming, typename Outgoing, typename Encoding, +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename BufferT> conveyor<void> -streaming_io_peer<Incoming, Outgoing, Encoding, +streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, BufferT>::on_read_disconnected() { return io_stream_->on_read_disconnected(); } -template <typename Incoming, typename Outgoing, typename Encoding, typename BufferT> -std::pair<own<streaming_io_peer<Incoming, Outgoing, Encoding, BufferT>>, - conveyor<data<Incoming,Encoding>>> +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename BufferT> +std::pair<own<streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, BufferT>>, + conveyor<data<Incoming,ContentEncoding>>> new_streaming_io_peer(own<async_io_stream> stream) { auto caf = - new_conveyor_and_feeder<data<Incoming, Encoding>>(); + new_conveyor_and_feeder<data<Incoming, ContentEncoding>>(); - return {heap<streaming_io_peer<Incoming, Outgoing, Encoding,BufferT>>( + return {heap<streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding,BufferT>>( std::move(caf.feeder), std::move(stream)), std::move(caf.conveyor)}; } |