|
Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
|
Statically allocated bounded asynchronous channel for typed producer-consumer coroutines. More...
#include <Channel.hpp>
Collaboration diagram for corium::async::Channel< T, Capacity >:Classes | |
| struct | PopAwaiter |
| Awaiter for popping an item asynchronously (suspends if channel is empty). More... | |
| struct | PushAwaiter |
| Awaiter for pushing an item asynchronously (suspends if channel is full). More... | |
Public Types | |
| using | ValueType = T |
Public Member Functions | |
| constexpr | Channel () noexcept=default |
| Channel (const Channel &)=delete | |
| void | close () noexcept |
| Close the channel. No more pushes will succeed. Remaining elements can still be popped. | |
| bool | empty () const noexcept |
| Check if channel is empty. | |
| bool | full () const noexcept |
| Check if channel is full. | |
| bool | isClosed () const noexcept |
| Check if channel is closed. | |
| Channel & | operator= (const Channel &)=delete |
| PopAwaiter | pop () noexcept |
| Pop an item from the channel asynchronously. | |
| PushAwaiter | push (T val) noexcept |
| Push an item into the channel asynchronously with backpressure suspension. | |
| size_t | size () const noexcept |
| Number of elements currently in the channel. | |
| bool | tryPop (T &out) noexcept |
| Non-blocking attempt to pop an item from the channel. | |
| bool | tryPush (T value) noexcept |
| Non-blocking attempt to push an item into the channel. | |
| ~Channel () | |
Statically allocated bounded asynchronous channel for typed producer-consumer coroutines.
| T | Element type transferred through the channel. |
| Capacity | Maximum capacity of the channel ring buffer (must be power of two or positive). |
| using corium::async::Channel< T, Capacity >::ValueType = T |
|
constexprdefaultnoexcept |
|
inline |
Here is the call graph for this function:
|
delete |
|
inlinenoexcept |
Close the channel. No more pushes will succeed. Remaining elements can still be popped.
Here is the caller graph for this function:
|
inlinenoexcept |
Check if channel is empty.
Here is the call graph for this function:
|
inlinenoexcept |
Check if channel is full.
Here is the call graph for this function:
|
inlinenoexcept |
Check if channel is closed.
Here is the caller graph for this function:
|
delete |
|
inlinenoexcept |
Pop an item from the channel asynchronously.
|
inlinenoexcept |
Push an item into the channel asynchronously with backpressure suspension.
| val | Item to push. |
|
inlinenoexcept |
Number of elements currently in the channel.
Here is the caller graph for this function:
|
inlinenoexcept |
Non-blocking attempt to pop an item from the channel.
| out | Variable to receive the popped item. |
Here is the caller graph for this function:
|
inlinenoexcept |
Non-blocking attempt to push an item into the channel.
| value | Item to push. |
Here is the caller graph for this function: