Condividi tramite


unbounded_buffer Class

 

An unbounded_buffer messaging block is a multi-target, multi-source, ordered propagator_block capable of storing an unbounded number of messages.

Syntax

template<
   class _Type
>
class unbounded_buffer : public propagator_block<multi_link_registry<ITarget<_Type>>, multi_link_registry<ISource<_Type>>>;

Parameters

  • _Type
    The payload type of the messages stored and propagated by the buffer.

Members

Public Constructors

Name

Description

unbounded_buffer::unbounded_buffer Constructor

Overloaded. Constructs an unbounded_buffer messaging block.

unbounded_buffer::~unbounded_buffer Destructor

Destroys the unbounded_buffer messaging block.

Public Methods

Name

Description

unbounded_buffer::dequeue Method

Removes an item from the unbounded_buffer messaging block.

unbounded_buffer::enqueue Method

Adds an item to the unbounded_buffer messaging block.

Protected Methods

Name

Description

unbounded_buffer::accept_message Method

Accepts a message that was offered by this unbounded_buffer messaging block, transferring ownership to the caller.

unbounded_buffer::consume_message Method

Consumes a message previously offered by the unbounded_buffer messaging block and reserved by the target, transferring ownership to the caller.

unbounded_buffer::link_target_notification Method

A callback that notifies that a new target has been linked to this unbounded_buffer messaging block.

unbounded_buffer::process_input_messages Method

Places the message_PMessage in this unbounded_buffer messaging block and tries to offer it to all of the linked targets.

unbounded_buffer::propagate_message Method

Asynchronously passes a message from an ISource block to this unbounded_buffer messaging block. It is invoked by the propagate method, when called by a source block.

unbounded_buffer::propagate_output_messages Method

Places the message_PMessage in this unbounded_buffer messaging block and tries to offer it to all of the linked targets. (Overrides source_block::propagate_output_messages.)

unbounded_buffer::release_message Method

Releases a previous message reservation. (Overrides source_block::release_message.)

unbounded_buffer::reserve_message Method

Reserves a message previously offered by this unbounded_buffer messaging block. (Overrides source_block::reserve_message.)

unbounded_buffer::resume_propagation Method

Resumes propagation after a reservation has been released. (Overrides source_block::resume_propagation.)

unbounded_buffer::send_message Method

Synchronously passes a message from an ISource block to this unbounded_buffer messaging block. It is invoked by the send method, when called by a source block.

unbounded_buffer::supports_anonymous_source Method

Overrides the supports_anonymous_source method to indicate that this block can accept messages offered to it by a source that is not linked. (Overrides ITarget::supports_anonymous_source.)

Remarks

For more information, see Asynchronous Message Blocks.

Inheritance Hierarchy

 ISource

 ITarget

 source_block

propagator_block

 unbounded_buffer

Requirements

Header: agents.h

Namespace: concurrency

See Also

concurrency Namespace
overwrite_buffer Class
single_assignment Class