C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::ChannelStorage< T, kCapacity > Class Template Reference

Overview

template<typename T, uint16_t kCapacity>
class pw::async2::ChannelStorage< T, kCapacity >

Fixed capacity storage for an asynchronous channel which supports multiple producers and multiple consumers.

ChannelStorage must outlive the channel in which it is used.

Inheritance diagram for pw::async2::ChannelStorage< T, kCapacity >:
pw::containers::StorageBase< kAlignment, kSizeBytes > pw::async2::internal::Channel< T >

Public Member Functions

bool active () const
 
constexpr uint16_t capacity () const
 

Friends

template<typename U , uint16_t kCap>
std::tuple< SpscChannelHandle< U >, Sender< U >, Receiver< U > > CreateSpscChannel (ChannelStorage< U, kCap > &storage)
 
template<typename U , uint16_t kCap>
std::tuple< MpscChannelHandle< U >, Receiver< U > > CreateMpscChannel (ChannelStorage< U, kCap > &storage)
 
template<typename U , uint16_t kCap>
std::tuple< SpmcChannelHandle< U >, Sender< U > > CreateSpmcChannel (ChannelStorage< U, kCap > &storage)
 
template<typename U , uint16_t kCap>
MpmcChannelHandle< U > CreateMpmcChannel (ChannelStorage< U, kCap > &storage)
 

Member Function Documentation

◆ active()

template<typename T , uint16_t kCapacity>
bool pw::async2::ChannelStorage< T, kCapacity >::active ( ) const
inline

Returns true if this channel storage is in use. If false, the storage can either be reused or safely destroyed.


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