File channel.hpp

File List > coroutine > channel.hpp

Go to the source code of this file.

C++ Coroutines based channel. It's a simplified form of the channel in The Go Language. More...

  • #include <mutex>
  • #include <tuple>

Namespaces

Type Name
namespace internal

Classes

Type Name
struct bypass_mutex
Lockable without lock operation.
class channel <T, M>
C++ Coroutines based channel.
class channel <T, M>
C++ Coroutines based channel.
class channel_peeker <typename T, typename M>
Extension of channel_reader for subroutines.
class channel_peeker <typename T, typename M>
Extension of channel_reader for subroutines.
class channel_reader <typename T, typename M>
Awaitable type for channel 's read operation. It moves the value from writer coroutine's frame to reader coroutine's frame.
class channel_reader <typename T, typename M>
Awaitable type for channel 's read operation. It moves the value from writer coroutine's frame to reader coroutine's frame.
class channel_writer <typename T, typename M>
Awaitable for channel 's write operation. It exposes a reference to the value forchannel_reader .
class channel_writer <typename T, typename M>
Awaitable for channel 's write operation. It exposes a reference to the value forchannel_reader .
class list <T>
Linked list without allocation.

Public Functions

Type Name
void select (channel< T, M > & ch, Fn && fn) noexcept
void select (Ch & ch, Fn && fn, Args &&... args) noexcept

Macros

Type Name
define LUNCLIFF_COROUTINE_CHANNEL_HPP

Detailed Description

Author:

github.com/luncliff (luncliff@gmail.com)

Copyright:

CC BY 4.0

Public Functions Documentation

function select

template<typename T typename T, typename M typename M, typename Fn typename Fn>
void select (
    channel < T, M > & ch,
    Fn && fn
) noexcept

Note:

If the channel is readable, acquire the value and invoke the function

See also: channel_peeker

function select

template<typename... Args, typename Ch typename Ch, typename Fn typename Fn>
void select (
    Ch & ch,
    Fn && fn,
    Args &&... args
) noexcept

Note:

For each pair, peeks a channel and invoke the function with the value if the peek was successful.

See also: test/channel_select_type.cpp

Macro Definition Documentation

define LUNCLIFF_COROUTINE_CHANNEL_HPP

#define LUNCLIFF_COROUTINE_CHANNEL_HPP 

The documentation for this class was generated from the following file interface/coroutine/channel.hpp