single_assignment Class
A single_assignment messaging block is a multi-target, multi-source, ordered propagator_block capable of storing a single, write-once message.
template<
class _Type
>
class single_assignment : public propagator_block<multi_link_registry<ITarget<_Type>>, multi_link_registry<ISource<_Type>>>;
Parameters
- _Type
The payload type of the message stored and propagated by the buffer.
Members
Public Constructors
Name |
Description |
---|---|
Overloaded. Constructs a single_assignment messaging block. |
|
Destroys the single_assignment messaging block. |
Public Methods
Name |
Description |
---|---|
Checks whether this single_assignment messaging block has been initialized with a value yet. |
|
Gets a reference to the current payload of the message being stored in the single_assignment messaging block. |
Protected Methods
Name |
Description |
---|---|
Accepts a message that was offered by this single_assignment messaging block, returning a copy of the message to the caller. |
|
Consumes a message previously offered by the single_assignment and reserved by the target, returning a copy of the message to the caller. |
|
A callback that notifies that a new target has been linked to this single_assignment messaging block. |
|
Asynchronously passes a message from an ISource block to this single_assignment messaging block. It is invoked by the propagate method, when called by a source block. |
|
Places the message_PMessage in this single_assignment messaging block and offers it to all of the linked targets. |
|
Releases a previous message reservation. (Overrides source_block::release_message.) |
|
Reserves a message previously offered by this single_assignment messaging block. (Overrides source_block::reserve_message.) |
|
Resumes propagation after a reservation has been released. (Overrides source_block::resume_propagation.) |
|
Synchronously passes a message from an ISource block to this single_assignment messaging block. It is invoked by the send method, when called by a source block. |
Remarks
A single_assignment messaging block propagates out copies of its message to each target.
For more information, see Asynchronous Message Blocks.
Inheritance Hierarchy
single_assignment
Requirements
Header: agents.h
Namespace: concurrency