propagator_block Class
The propagator_block class is an abstract base class for message blocks that are both a source and target. It combines the functionality of both the source_block and target_block classes.
template<
class _TargetLinkRegistry,
class _SourceLinkRegistry,
class _MessageProcessorType = ordered_message_processor<typename _TargetLinkRegistry::type::type>
>
class propagator_block : public source_block<_TargetLinkRegistry, _MessageProcessorType>, public ITarget<typename _SourceLinkRegistry::type::source_type>;
Parameters
_TargetLinkRegistry
The link registry to be used for holding the target links._SourceLinkRegistry
The link registry to be used for holding the source links._MessageProcessorType
The processor type for message processing.
Members
Public Typedefs
Name |
Description |
---|---|
source_iterator |
The type of the iterator for the source_link_manager for this propagator_block. |
Public Constructors
Name |
Description |
---|---|
Constructs a propagator_block object. |
|
Destroys a propagator_block object. |
Public Methods
Name |
Description |
---|---|
Asynchronously passes a message from a source block to this target block. |
|
Synchronously initiates a message to this block. Called by an ISource block. When this function completes, the message will already have propagated into the block. |
Protected Methods
Name |
Description |
---|---|
Indicates to the block that new messages should be declined. |
|
Initializes the base object. Specifically, the message_processor object needs to be initialized. |
|
Links a specified source block to this propagator_block object. |
|
Process input messages. This is only useful for propagator blocks, which derive from source_block (Overrides source_block::process_input_messages.) |
|
When overridden in a derived class, this method asynchronously passes a message from an ISource block to this propagator_block object. It is invoked by the propagate method, when called by a source block. |
|
Registers a filter method that will be invoked on every received message. |
|
Removes all the source and target network links from this propagator_block object. |
|
When overridden in a derived class, this method synchronously passes a message from an ISource block to this propagator_block object. It is invoked by the send method, when called by a source block. |
|
Unlinks a specified source block from this propagator_block object. |
|
Unlinks all source blocks from this propagator_block object. (Overrides ITarget::unlink_sources.) |
Remarks
To avoid multiple inheritance, the propagator_block class inherits from the source_block class and ITarget abstract class. Most of the functionality in the target_block class is replicated here.
Inheritance Hierarchy
propagator_block
Requirements
Header: agents.h
Namespace: concurrency