source_link_manager Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

The source_link_manager object manages messaging block network links to ISource blocks.

template<class _LinkRegistry>
class source_link_manager;

Parameters

_LinkRegistry
The network link registry.

Public Typedefs

NameDescription
const_pointerA type that provides a pointer to a const element in a source_link_manager object.
const_referenceA type that provides a reference to a const element stored in a source_link_manager object for reading and performing const operations.
iteratorA type that provides an iterator that can read or modify any element in the source_link_manager object.
typeThe type of link registry being managed by the source_link_manager object.

Public Constructors

NameDescription
source_link_manager::source_link_manager ConstructorConstructs a source_link_manager object.
source_link_manager::~source_link_manager DestructorDestroys the source_link_manager object.

Public Methods

NameDescription
source_link_manager::add MethodAdds a source link to the source_link_manager object.
source_link_manager::begin MethodReturns an iterator to the first element in the source_link_manager object.
source_link_manager::contains MethodSearches the network_link_registry within this source_link_manager object for a specified block.
source_link_manager::count MethodCounts the number of linked blocks in the source_link_manager object.
source_link_manager::reference MethodAcquires a reference on the source_link_manager object.
source_link_manager::register_target_block MethodRegisters the target block that holds this source_link_manager object.
source_link_manager::release MethodReleases the reference on the source_link_manager object.
source_link_manager::remove MethodRemoves a link from the source_link_manager object.
source_link_manager::set_bound MethodSets the maximum number of source links that can be added to this source_link_manager object.

Currently, the source blocks are reference counted. This is a wrapper on a network_link_registry object that allows concurrent access to the links and provides the ability to reference the links through callbacks. Message blocks ( target_blocks or propagator_blocks) should use this class for their source links.

source_link_manager

Header: agents.h

Namespace: concurrency

Adds a source link to the source_link_manager object.

void add(_EType _Link);

Parameters

_Link
A pointer to a block to be added.

Returns an iterator to the first element in the source_link_manager object.

iterator begin();

Return Value

An iterator addressing the first element in the source_link_manager object.

Remarks

The end state of the iterator is indicated by a NULL link.

Searches the network_link_registry within this source_link_manager object for a specified block.

bool contains(_EType _Link);

Parameters

_Link
A pointer to a block that is to be searched for in the source_link_manager object.

Return Value

true if the specified block was found, false otherwise.

Counts the number of linked blocks in the source_link_manager object.

size_t count();

Return Value

The number of linked blocks in the source_link_manager object.

Acquires a reference on the source_link_manager object.

void reference();

Registers the target block that holds this source_link_manager object.

void register_target_block(_Inout_ ITarget<typename _Block::source_type>* _PTarget);

Parameters

_PTarget
The target block holding this source_link_manager object.

Releases the reference on the source_link_manager object.

void release();

Removes a link from the source_link_manager object.

bool remove(_EType _Link);

Parameters

_Link
A pointer to a block to be removed, if found.

Return Value

true if the link was found and removed, false otherwise.

Sets the maximum number of source links that can be added to this source_link_manager object.

void set_bound(size_t _MaxLinks);

Parameters

_MaxLinks
The maximum number of links.

Constructs a source_link_manager object.

source_link_manager();

Destroys the source_link_manager object.

~source_link_manager();

concurrency Namespace
single_link_registry Class
multi_link_registry Class

Show: