C++ Channel
|
An output iterator pushes elements into a channel. Blocking until the channel is not full. More...
#include <blocking_iterator.hpp>
Public Types | |
using | value_type = typename Channel::value_type |
The type of the elements stored in the channel. | |
using | reference = const value_type & |
Constant reference to the type of the elements stored in the channel. | |
using | iterator_category = std::output_iterator_tag |
Supporting writing of elements. | |
using | difference_type = std::ptrdiff_t |
Signed integral type for iterator difference. | |
using | pointer = const value_type * |
Pointer type to the value_type. | |
Public Member Functions | |
blocking_writer_iterator (Channel &chan) | |
Constructs a blocking iterator from a channel reference. | |
blocking_writer_iterator & | operator= (reference value) |
Writes an element into the channel, blocking until space is available. | |
blocking_writer_iterator & | operator* () |
Not applicable (handled by operator=). | |
blocking_writer_iterator & | operator++ () |
Not applicable (handled by operator=). | |
blocking_writer_iterator | operator++ (int) |
Not applicable (handled by operator=). | |
An output iterator pushes elements into a channel. Blocking until the channel is not full.
Used to integrate with standard algorithms that require an output iterator.
Channel | Type of channel being iterated. |
|
inlineexplicit |
Constructs a blocking iterator from a channel reference.
chan | Reference to the channel this iterator will write into. |
|
inline |
Not applicable (handled by operator=).
|
inline |
Not applicable (handled by operator=).
|
inline |
Not applicable (handled by operator=).
|
inline |
Writes an element into the channel, blocking until space is available.
value | The value to be written into the channel. |