choice Class
A choice messaging block is a multi-source, single-target block that represents a control-flow interaction with a set of sources. The choice block will wait for any one of multiple sources to produce a message and will propagate the index of the source that produced the message.
template<
class _Type
>
class choice: public ISource<size_t>;
Parameters
- _Type
A tuple-based type representing the payloads of the input sources.
Members
Public Typedefs
Name |
Description |
---|---|
type |
A type alias for _Type. |
Public Constructors
Name |
Description |
---|---|
Overloaded. Constructs a choice messaging block. |
|
Destroys the choice messaging block. |
Public Methods
Name |
Description |
---|---|
Accepts a message that was offered by this choice block, transferring ownership to the caller. |
|
Acquires a reference count on this choice messaging block, to prevent deletion. |
|
Consumes a message previously offered by this choice messaging block and successfully reserved by the target, transferring ownership to the caller. |
|
Checks whether this choice messaging block has been initialized with a value yet. |
|
Returns an index into the tuple representing the element selected by the choice messaging block. |
|
Links a target block to this choice messaging block. |
|
Releases a previous successful message reservation. |
|
Releases a reference count on this choice messaging block. |
|
Reserves a message previously offered by this choice messaging block. |
|
Unlinks a target block from this choice messaging block. |
|
Unlinks all targets from this choice messaging block. (Overrides ISource::unlink_targets.) |
|
Gets the message whose index was selected by the choice messaging block. |
Remarks
The choice block ensures that only one of the incoming messages is consumed.
For more information, see Asynchronous Message Blocks.
Inheritance Hierarchy
Requirements
Header: agents.h
Namespace: Concurrency