Template Class Channel

Class Documentation

template<typename T>
class Channel

A typed channel with an unbounded number of entries.

Public Types

using type = T

Public Functions

inline Channel(Actor &actor)

associated with a specified actor, which allows that actor to wait for this channel at the same time as others.

inline Channel()

not associated with any actor

template<typename TT>
inline void push(TT &&item)
template<typename ...Args>
inline void emplace(Args&&... args)
inline T pop()

pop an element, will assert if empty

inline T read()

pop an element, blocking if empty

inline void clear()

remove all elements

inline bool readable()

is this non-empty?

inline bool readable_with_lock()

is this non-empty? requires the associated lock to be held