Support Class Library
A set of tools providing classes and utility
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
scl::async::details::ChannelReceiver< Chan > Class Template Reference

#include "Channel.h"

Collaboration diagram for scl::async::details::ChannelReceiver< Chan >:
Collaboration graph
[legend]

Public Types

using channel_type = Chan
 The type of the channel. More...
 
using receiver_traits = channel_actor_traits< ChannelReceiver >
 The type of the traits for this receiver. More...
 
using lock_type = typename receiver_traits::lock_type
 The type of locks used by the traits. More...
 
template<class L >
using guard_type = typename receiver_traits::template guard_type< L >
 
using queue_type = typename receiver_traits::queue_type
 The type of queue used by the channel. More...
 
using value_type = typename receiver_traits::value_type
 The type of values used by the channel. More...
 
using optional_type = scl::utils::Optional< value_type >
 The alternative type when there might not be a value. More...
 

Public Member Functions

 ChannelReceiver (const ChannelReceiver &)=delete
 
ChannelReceiveroperator= (const ChannelReceiver &)=delete
 
 ChannelReceiver (ChannelReceiver &&)=delete
 
ChannelReceiveroperator= (ChannelReceiver &&)=delete
 
value_type pop ()
 Get a value from the channel. More...
 
template<class Rep , class Period >
optional_type tryPop (const std::chrono::duration< Rep, Period > &duration)
 Wait for a given duration before popping. More...
 
value_type dequeue ()
 Alias for ChannelReceiver::receive. More...
 
value_type receive ()
 Alias for ChannelReceiver::receive. More...
 
template<class Rep , class Period >
optional_type tryDeque (const std::chrono::duration< Rep, Period > &duration)
 Alias for ChannelReceiver::tryPop. More...
 
template<class Rep , class Period >
optional_type tryReceive (const std::chrono::duration< Rep, Period > &duration)
 Alias for ChannelReceiver::tryPop. More...
 
template<class U = value_type>
ChannelReceiveroperator>> (U &value)
 Alias for ChannelReceiver::receive. More...
 

Public Attributes

friend receiver_traits
 
friend channel_type
 

Protected Member Functions

 ChannelReceiver (channel_type &chan)
 Construct a receiver from its channel. More...
 

Protected Attributes

channel_typechannel
 A (safe) pointer to the channel. More...
 
receiver_traits traits
 The traits for this receiver. More...
 

Detailed Description

template<class Chan>
class scl::async::details::ChannelReceiver< Chan >

Definition at line 25 of file Channel.h.

Member Typedef Documentation

◆ channel_type

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::channel_type

The type of the channel.

Definition at line 573 of file Channel.h.

◆ guard_type

template<class Chan>
template<class L >
scl::async::details::ChannelReceiver< Chan >::guard_type
Template Parameters
Lbeing the type of the lock The type of lock guards used by the traits

Definition at line 593 of file Channel.h.

◆ lock_type

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::lock_type

The type of locks used by the traits.

Definition at line 585 of file Channel.h.

◆ optional_type

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::optional_type

The alternative type when there might not be a value.

Definition at line 611 of file Channel.h.

◆ queue_type

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::queue_type

The type of queue used by the channel.

Definition at line 599 of file Channel.h.

◆ receiver_traits

The type of the traits for this receiver.

Definition at line 579 of file Channel.h.

◆ value_type

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::value_type

The type of values used by the channel.

Definition at line 605 of file Channel.h.

Constructor & Destructor Documentation

◆ ChannelReceiver() [1/3]

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::ChannelReceiver ( channel_type chan)
inlineexplicitprotected

Construct a receiver from its channel.

Parameters
chanbeing the channel to construct from

Definition at line 631 of file Channel.h.

◆ ChannelReceiver() [2/3]

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::ChannelReceiver ( const ChannelReceiver< Chan > &  )
delete

◆ ChannelReceiver() [3/3]

template<class Chan>
scl::async::details::ChannelReceiver< Chan >::ChannelReceiver ( ChannelReceiver< Chan > &&  )
delete

Member Function Documentation

◆ dequeue()

template<class Chan>
value_type scl::async::details::ChannelReceiver< Chan >::dequeue ( )
inline

Alias for ChannelReceiver::receive.

Definition at line 680 of file Channel.h.

◆ operator=() [1/2]

template<class Chan>
ChannelReceiver& scl::async::details::ChannelReceiver< Chan >::operator= ( const ChannelReceiver< Chan > &  )
delete

◆ operator=() [2/2]

template<class Chan>
ChannelReceiver& scl::async::details::ChannelReceiver< Chan >::operator= ( ChannelReceiver< Chan > &&  )
delete

◆ operator>>()

template<class Chan>
template<class U = value_type>
ChannelReceiver& scl::async::details::ChannelReceiver< Chan >::operator>> ( U &  value)
inline

Alias for ChannelReceiver::receive.

Template Parameters
Ubeing the type to store the data in (defaults to ChannelReceiver::value_type)
Returns
a reference to this ChannelReceiver

Definition at line 709 of file Channel.h.

◆ pop()

template<class Chan>
value_type scl::async::details::ChannelReceiver< Chan >::pop ( )
inline

Get a value from the channel.

Returns
the first remaining value

Definition at line 644 of file Channel.h.

◆ receive()

template<class Chan>
value_type scl::async::details::ChannelReceiver< Chan >::receive ( )
inline

Alias for ChannelReceiver::receive.

Definition at line 685 of file Channel.h.

◆ tryDeque()

template<class Chan>
template<class Rep , class Period >
optional_type scl::async::details::ChannelReceiver< Chan >::tryDeque ( const std::chrono::duration< Rep, Period > &  duration)
inline

Alias for ChannelReceiver::tryPop.

Definition at line 691 of file Channel.h.

◆ tryPop()

template<class Chan>
template<class Rep , class Period >
optional_type scl::async::details::ChannelReceiver< Chan >::tryPop ( const std::chrono::duration< Rep, Period > &  duration)
inline

Wait for a given duration before popping.

Template Parameters
Repbeing the time representation type
Periodbeing the time period type
Parameters
durationbeing the time to wait
Returns
NONE if it could not get a value, a value otherwise

Definition at line 663 of file Channel.h.

◆ tryReceive()

template<class Chan>
template<class Rep , class Period >
optional_type scl::async::details::ChannelReceiver< Chan >::tryReceive ( const std::chrono::duration< Rep, Period > &  duration)
inline

Alias for ChannelReceiver::tryPop.

Definition at line 699 of file Channel.h.

Member Data Documentation

◆ channel

template<class Chan>
channel_type* scl::async::details::ChannelReceiver< Chan >::channel
protected

A (safe) pointer to the channel.

Definition at line 620 of file Channel.h.

◆ channel_type

template<class Chan>
friend scl::async::details::ChannelReceiver< Chan >::channel_type

Definition at line 614 of file Channel.h.

◆ receiver_traits

template<class Chan>
friend scl::async::details::ChannelReceiver< Chan >::receiver_traits

Definition at line 613 of file Channel.h.

◆ traits

template<class Chan>
receiver_traits scl::async::details::ChannelReceiver< Chan >::traits
protected

The traits for this receiver.

Definition at line 625 of file Channel.h.


The documentation for this class was generated from the following file: