diff options
Diffstat (limited to 'modules/io_codec/c++/io_peer.tmpl.hpp')
-rw-r--r-- | modules/io_codec/c++/io_peer.tmpl.hpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/modules/io_codec/c++/io_peer.tmpl.hpp b/modules/io_codec/c++/io_peer.tmpl.hpp index 0322631..e046f92 100644 --- a/modules/io_codec/c++/io_peer.tmpl.hpp +++ b/modules/io_codec/c++/io_peer.tmpl.hpp @@ -1,25 +1,24 @@ namespace saw { } -#include <iostream> namespace saw { -template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename Net, typename BufferT> -streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, +streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, Net, BufferT>:: streaming_io_peer( own<conveyor_feeder<data<Incoming, ContentEncoding>>> feed, - own<async_io_stream> str) + own<async_io_stream<Net>> str) : streaming_io_peer{std::move(feed), std::move(str), {}} {} -template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename BufferT> -streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename Net, typename BufferT> +streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, Net, BufferT>:: streaming_io_peer( own<conveyor_feeder<data<Incoming, ContentEncoding>>> feed, - own<async_io_stream> stream, transport<TransportEncoding> in_codec) + own<async_io_stream<Net>> stream, transport<TransportEncoding> in_codec) : incoming_feeder_{std::move(feed)}, io_stream_{std::move(stream)}, in_codec_{std::move(in_codec)}, @@ -99,8 +98,8 @@ streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, template <typename Incoming, typename Outgoing, typename TransportEncoding, - typename ContentEncoding, typename BufferT> -error_or<void> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, + typename ContentEncoding, typename Net, typename BufferT> +error_or<void> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, Net, BufferT>::send(data<Outgoing, ContentEncoding> msg) { bool restart_write = (out_buffer_.read_segment_length() == 0u); @@ -132,10 +131,10 @@ error_or<void> streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentE return void_t{}; } -template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename Net, typename BufferT> conveyor<void> -streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, +streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, Net, BufferT>::on_disconnected() { io_read_disconnected_ = io_stream_->on_read_disconnected().then([this](){ if(disconnect_feeder_){ @@ -148,14 +147,14 @@ streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, return std::move(caf.conveyor); } -template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename BufferT> -std::pair<own<streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, BufferT>>, +template <typename Incoming, typename Outgoing, typename TransportEncoding, typename ContentEncoding, typename Net, typename BufferT> +std::pair<own<streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding, Net, BufferT>>, conveyor<data<Incoming,ContentEncoding>>> -new_streaming_io_peer(own<async_io_stream> stream) { +new_streaming_io_peer(own<async_io_stream<Net>> stream) { auto caf = new_conveyor_and_feeder<data<Incoming, ContentEncoding>>(); - return {heap<streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding,BufferT>>( + return {heap<streaming_io_peer<Incoming, Outgoing, TransportEncoding, ContentEncoding,Net,BufferT>>( std::move(caf.feeder), std::move(stream)), std::move(caf.conveyor)}; } |