Export (0) Print
Expand All
Expand Minimize

try_receive Function

A general try-receive implementation, allowing a context to look for data from exactly one source and filter the values that are accepted. If the data is not ready, the method will return false.

template <
   class _Type
>
bool try_receive(
   _Inout_ ISource<_Type> * _Src,
   _Type & _value
);

template <
   class _Type
>
bool try_receive(
   _Inout_ ISource<_Type> * _Src,
   _Type & _value,
   typename ITarget<_Type>::filter_method const& _Filter_proc
);

template <
   class _Type
>
bool try_receive(
   ISource<_Type> & _Src,
   _Type & _value
);

template <
   class _Type
>
bool try_receive(
   ISource<_Type> & _Src,
   _Type & _value,
   typename ITarget<_Type>::filter_method const& _Filter_proc
);

_Type

The payload type

_Src

A pointer or reference to the source from which data is expected.

_value

A reference to a location where the result will be placed.

_Filter_proc

A filter function which determines whether messages should be accepted.

A bool value indicating whether or not a payload was placed in _value.

For more information, see Message Passing Functions.

Header: agents.h

Namespace: concurrency

Show:
© 2014 Microsoft