C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::internal::BaseChannelHandle Class Reference

Overview

A handle to a channel, used to create senders and receivers.

After all desired senders and receivers are created, the handle should be released. The channel will remain allocated and open as long as at least one sender and one receiver are alive.

Inheritance diagram for pw::async2::internal::BaseChannelHandle:
pw::async2::ChannelHandle< T > pw::async2::McChannelHandle< T > pw::async2::MpChannelHandle< T > pw::async2::MpmcChannelHandle< T > pw::async2::MpscChannelHandle< T > pw::async2::SpmcChannelHandle< T > pw::async2::SpscChannelHandle< T >

Public Member Functions

 BaseChannelHandle (const BaseChannelHandle &other)
 
bool is_open () const
 
void Close ()
 
void Release ()
 

Protected Member Functions

 BaseChannelHandle (BaseChannel &channel)
 
BaseChannelHandleoperator= (const BaseChannelHandle &other)
 
 BaseChannelHandle (BaseChannelHandle &&other) noexcept
 
BaseChannelHandleoperator= (BaseChannelHandle &&other) noexcept
 
constexpr BaseChannelchannel () const PW_LOCK_RETURNED(channel_)
 

Member Function Documentation

◆ Close()

void pw::async2::internal::BaseChannelHandle::Close ( )

Forces the channel to close, even if there are still active senders or receivers.

◆ Release()

void pw::async2::internal::BaseChannelHandle::Release ( )

Drops the handle to the channel, preventing creation of new senders and receivers.

This function should always be called when the handle is no longer needed. Holding onto an unreleased handle can prevent the channel from being closed (and deallocated if the channel is dynamic).


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