20#include "pw_async2/dispatcher.h"
21#include "pw_async2/poll.h"
22#include "pw_channel/channel.h"
23#include "pw_multibuf/allocator.h"
24#include "pw_multibuf/allocator_async.h"
25#include "pw_sync/lock_annotations.h"
26#include "pw_sync/mutex.h"
28namespace pw::channel {
33template <DataType kType>
46template <DataType kType>
61 return first_.channel();
71 return second_.channel();
102 :
public Implement<ReliableDatagramReaderWriter> {
114 ForwardingChannel* sibling,
115 multibuf::MultiBufAllocator& write_alloc)
116 : pair_(pair), sibling_(*sibling), write_alloc_future_(write_alloc) {}
125 write_alloc_future_.SetDesiredSize(min_bytes);
126 return write_alloc_future_.Pend(cx);
143 std::optional<multibuf::MultiBuf> read_queue_ PW_GUARDED_BY(pair_.mutex_);
150 :
public Implement<ReliableByteReaderWriter> {
162 ForwardingChannel* sibling,
163 multibuf::MultiBufAllocator& write_alloc)
164 : pair_(pair), sibling_(*sibling), write_alloc_future_(write_alloc) {}
175 write_alloc_future_.SetDesiredSize(min_bytes);
176 return write_alloc_future_.Pend(cx);
198template <DataType kType>
202 : first_(*this, &second_, first_write_allocator),
203 second_(*this, &first_, second_write_allocator) {}
Definition: dispatcher_base.h:52
Definition: dispatcher_base.h:318
Definition: forwarding_channel.h:47
Channel< kType, kReliable, kReadable, kWritable > & second()
Returns the second channel in the pair.
Definition: forwarding_channel.h:70
Channel< kType, kReliable, kReadable, kWritable > & first()
Returns the first channel in the pair.
Definition: forwarding_channel.h:60
const Channel< kType, kReliable, kReadable, kWritable > & second() const
Returns a const reference to the second channel in the pair.
Definition: forwarding_channel.h:75
const Channel< kType, kReliable, kReadable, kWritable > & first() const
Returns a const reference to the first channel in the pair.
Definition: forwarding_channel.h:65
Definition: channel.h:583
Definition: forwarding_channel.h:34
Definition: allocator_async.h:90
Definition: allocator.h:54
Definition: multibuf.h:245
constexpr Status OkStatus()
Definition: status.h:234