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>
48template <DataType kType>
63 return first_.channel();
73 return second_.channel();
104 :
public Implement<ReliableDatagramReaderWriter> {
116 ForwardingChannel* sibling,
117 multibuf::MultiBufAllocator& write_alloc)
118 : pair_(pair), sibling_(*sibling), write_alloc_future_(write_alloc) {}
127 write_alloc_future_.SetDesiredSize(min_bytes);
128 return write_alloc_future_.Pend(cx);
145 std::optional<multibuf::MultiBuf> read_queue_
PW_GUARDED_BY(pair_.mutex_);
152 :
public Implement<ReliableByteReaderWriter> {
164 ForwardingChannel* sibling,
165 multibuf::MultiBufAllocator& write_alloc)
166 : pair_(pair), sibling_(*sibling), write_alloc_future_(write_alloc) {}
177 write_alloc_future_.SetDesiredSize(min_bytes);
178 return write_alloc_future_.Pend(cx);
200template <DataType kType>
204 : first_(*this, &second_, first_write_allocator),
205 second_(*this, &first_, second_write_allocator) {}
Definition: forwarding_channel.h:49
Definition: channel.h:583
Definition: forwarding_channel.h:34
Definition: allocator_async.h:93
Definition: allocator.h:57
Definition: multibuf_v1.h:248
constexpr Poll Ready()
Returns a value indicating completion.
Definition: poll.h:255
Channel< kType, kReliable, kReadable, kWritable > & second()
Returns the second channel in the pair.
Definition: forwarding_channel.h:72
Channel< kType, kReliable, kReadable, kWritable > & first()
Returns the first channel in the pair.
Definition: forwarding_channel.h:62
const Channel< kType, kReliable, kReadable, kWritable > & second() const
Returns a const reference to the second channel in the pair.
Definition: forwarding_channel.h:77
const Channel< kType, kReliable, kReadable, kWritable > & first() const
Returns a const reference to the first channel in the pair.
Definition: forwarding_channel.h:67
constexpr Status OkStatus()
Definition: status.h:297
#define PW_GUARDED_BY(x)
Definition: lock_annotations.h:60