multi_link_registry Class

 

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

The multi_link_registry object is a network_link_registry that manages multiple source blocks or multiple target blocks.

template<class _Block>
class multi_link_registry : public network_link_registry<_Block>;

Parameters

_Block
The block data type being stored in the multi_link_registry object.

Public Constructors

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

Public Methods

NameDescription
multi_link_registry::add MethodAdds a link to the multi_link_registry object. (Overrides network_link_registry::add.)
multi_link_registry::begin MethodReturns an iterator to the first element in the multi_link_registry object. (Overrides network_link_registry::begin.)
multi_link_registry::contains MethodSearches the multi_link_registry object for a specified block. (Overrides network_link_registry::contains.)
multi_link_registry::count MethodCounts the number of items in the multi_link_registry object. (Overrides network_link_registry::count.)
multi_link_registry::remove MethodRemoves a link from the multi_link_registry object. (Overrides network_link_registry::remove.)
multi_link_registry::set_bound MethodSets an upper bound on the number of links that the multi_link_registry object can hold.

network_link_registry

multi_link_registry

Header: agents.h

Namespace: concurrency

Adds a link to the multi_link_registry object.

virtual void add(_EType _Link);

Parameters

_Link
A pointer to a block to be added.

Remarks

The method throws an invalid_link_target exception if the link is already present in the registry, or if a bound has already been set with the set_bound function and a link has since been removed.

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

virtual iterator begin();

Return Value

An iterator addressing the first element in the multi_link_registry object.

Remarks

The end state is indicated by a NULL link.

Searches the multi_link_registry object for a specified block.

virtual bool contains(_EType _Link);

Parameters

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

Return Value

true if the specified block was found, false otherwise.

Counts the number of items in the multi_link_registry object.

virtual size_t count();

Return Value

The number of items in the multi_link_registry object.

Constructs a multi_link_registry object.

multi_link_registry();

Destroys the multi_link_registry object.

virtual ~multi_link_registry();

Remarks

The method throws an invalid_operation exception if called before all links are removed.

Removes a link from the multi_link_registry object.

virtual 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 an upper bound on the number of links that the multi_link_registry object can hold.

void set_bound(size_t _MaxLinks);

Parameters

_MaxLinks
The maximum number of links that the multi_link_registry object can hold.

Remarks

After a bound is set, unlinking an entry will cause the multi_link_registry object to enter an immutable state where further calls to add will throw an invalid_link_target exception.

concurrency Namespace
single_link_registry Class

Show: