C++ Channel
|
#include "blocking_iterator.hpp"
#include "nodiscard.hpp"
#include "storage.hpp"
#include <condition_variable>
#include <cstdlib>
#include <mutex>
#include <stdexcept>
#include <type_traits>
Go to the source code of this file.
Classes | |
class | msd::closed_channel |
Exception thrown if trying to write on closed channel. More... | |
struct | msd::is_supported_type< T > |
Trait to check if a type is supported by msd::channel. More... | |
struct | msd::is_static_storage< typename, typename > |
Trait to check if a storage type has a static capacity member. More... | |
struct | msd::is_static_storage< Storage, decltype((void) Storage::capacity, void())> |
Trait to check if a storage type has a static capacity member. More... | |
class | msd::channel< T, Storage > |
Thread-safe container for sharing data between threads. More... | |
Typedefs | |
template<typename T > | |
using | msd::default_storage = queue_storage< T > |
Default storage for msd::channel. | |
Functions | |
template<typename T , typename Storage > | |
channel< typename std::decay< T >::type, Storage > & | msd::operator<< (channel< typename std::decay< T >::type, Storage > &chan, T &&value) |
Pushes an element into the channel. | |
template<typename T , typename Storage > | |
channel< T, Storage > & | msd::operator>> (channel< T, Storage > &chan, T &out) |
Pops an element from the channel. | |
msd::default_storage |
Default storage for msd::channel.
T | The type of the elements. |
channel< typename std::decay< T >::type, Storage > & msd::operator<< | ( | channel< typename std::decay< T >::type, Storage > & | chan, |
T && | value | ||
) |
Pushes an element into the channel.
chan | Channel to write to. |
value | Value to write. |
closed_channel | if channel is closed. |
channel< T, Storage > & msd::operator>> | ( | channel< T, Storage > & | chan, |
T & | out | ||
) |
Pops an element from the channel.
chan | Channel to read from. |
out | Where to write read value. |