Pigweed
C/C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
pw::channel::PacketChannel< T, kProperties > Class Template Reference
Inheritance diagram for pw::channel::PacketChannel< T, kProperties >:
pw::channel::AnyPacketChannel< Packet > pw::channel::AnyPacketChannel< Packet > pw::channel::AnyPacketChannel< Packet > pw::channel::internal::BasePacketChannelImpl< Packet, kProperties > pw::channel::internal::BasePacketChannelImpl< Packet, kProperties > pw::channel::internal::BasePacketChannelImpl< Packet, kProperties >

Public Types

using Packet = T
 

Public Member Functions

constexpr bool is_read_open () const
 
constexpr bool is_write_open () const
 
constexpr bool is_read_or_write_open () const
 
async2::Poll< Result< Packet > > PendRead (async2::Context &cx)
 
async2::Poll< Result< PendingWrite< Packet > > > PendReadyToWrite (async2::Context &cx, size_t num=1)
 
async2::Poll PendWrite (async2::Context &cx)
 
void SetAvailableWrites (uint16_t available_writes)
 
void AcknowledgeWrites (uint16_t num_completed)
 
async2::Poll< StatusPendClose (async2::Context &cx)
 
template<typename Sibling , typename = internal::EnableIfConvertible<PacketChannel, Sibling>>
constexpr operator Sibling & ()
 Channels may be implicitly converted to other compatible channel types.
 
template<typename Sibling , typename = internal::EnableIfConvertible<PacketChannel, Sibling>>
constexpr operator const Sibling & () const
 
constexpr operator AnyPacketChannel< Packet > & ()
 
constexpr operator const AnyPacketChannel< Packet > & () const
 
template<typename Sibling >
Sibling & as ()
 Returns a reference to this as another compatible packet channel type.
 
template<typename Sibling >
const Sibling & as () const
 
template<Property... kOtherProperties>
auto & as ()
 
template<Property... kOtherProperties>
const auto & as () const
 

Static Public Member Functions

static constexpr bool readable ()
 
static constexpr bool writable ()
 

Protected Member Functions

uint16_t GetAvailableWrites () const
 

Friends

template<typename >
class AnyPacketChannel
 

Detailed Description

template<typename T, Property... kProperties>
class pw::channel::PacketChannel< T, kProperties >

Interface that supports reading and writing writing packets. The supported operations are reflected in the type.

PacketChannel is typically referred to by one its aliases: pw::channel::PacketReader, pw::channel::PacketWriter, or pw::channel::PacketReaderWriter.

To implement a packet channel, derive from pw::channel::Implement<> with the desired PacketChannel type.

Warning
This class is in an early, experimental state. Do not use it until this warning is removed (https://pwbug.dev/421962771).

Member Function Documentation

◆ as()

template<typename T , Property... kProperties>
template<Property... kOtherProperties>
auto & pw::channel::PacketChannel< T, kProperties >::as ( )
inline

Returns a reference to this channel as another channel with the specified properties, which must be compatible.


The documentation for this class was generated from the following file: