call Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

A call messaging block is a multi-source, ordered target_block that invokes a specified function when receiving a message.

template<class T, class _FunctorType = std::tr1::function<void(T const&)>>
class call : public target_block<multi_link_registry<ISource<T>>>;

Parameters

T
The payload type of the messages propagated to this block.

_FunctorType
The signature of functions that this block can accept.

Public Constructors

NameDescription
call::call ConstructorOverloaded. Constructs a call messaging block.
call::~call DestructorDestroys the call messaging block.

Protected Methods

NameDescription
call::process_input_messages MethodExecutes the call function on the input messages.
call::process_message MethodProcesses a message that was accepted by this call messaging block.
call::propagate_message MethodAsynchronously passes a message from an ISource block to this call messaging block. It is invoked by the propagate method, when called by a source block.
call::send_message MethodSynchronously passes a message from an ISource block to this call messaging block. It is invoked by the send method, when called by a source block.
call::supports_anonymous_source MethodOverrides 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.)

For more information, see Asynchronous Message Blocks.

ITarget

target_block

call

Header: agents.h

Namespace: concurrency

Constructs a call messaging block.

call(
    _Call_method const& _Func);

call(
    _Call_method const& _Func,
    filter_method const& _Filter);

call(
    Scheduler& _PScheduler,
    _Call_method const& _Func);

call(
    Scheduler& _PScheduler,
    _Call_method const& _Func,
    filter_method const& _Filter);

call(
    ScheduleGroup& _PScheduleGroup,
    _Call_method const& _Func);

call(
    ScheduleGroup& _PScheduleGroup,
    _Call_method const& _Func,
    filter_method const& _Filter);

Parameters

_Func
A function that will be invoked for each accepted message.

_Filter
A filter function which determines whether offered messages should be accepted.

_PScheduler
The Scheduler object within which the propagation task for the call messaging block is scheduled.

_PScheduleGroup
The ScheduleGroup object within which the propagation task for the call messaging block is scheduled. The Scheduler object used is implied by the schedule group.

Remarks

The runtime uses the default scheduler if you do not specify the _PScheduler or _PScheduleGroup parameters.

The type _Call_method is a functor with signature void (T const &) which is invoked by this call messaging block to process a message.

The type filter_method is a functor with signature bool (T const &) which is invoked by this call messaging block to determine whether or not it should accept an offered message.

Destroys the call messaging block.

~call();

Executes the call function on the input messages.

virtual void process_input_messages(_Inout_ message<T>* _PMessage);

Parameters

_PMessage

Processes a message that was accepted by this call messaging block.

virtual void process_message(_Inout_ message<T>* _PMessage);

Parameters

_PMessage
A pointer to the message that is to be handled.

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

virtual message_status propagate_message(
    _Inout_ message<T>* _PMessage,
    _Inout_ ISource<T>* _PSource);

Parameters

_PMessage
A pointer to the message object.

_PSource
A pointer to the source block offering the message.

Return Value

A message_status indication of what the target decided to do with the message.

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

virtual message_status send_message(
    _Inout_ message<T>* _PMessage,
    _Inout_ ISource<T>* _PSource);

Parameters

_PMessage
A pointer to the message object.

_PSource
A pointer to the source block offering the message.

Return Value

A message_status indication of what the target decided to do with the message.

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

virtual bool supports_anonymous_source();

Return Value

true because the block does not postpone offered messages.

concurrency Namespace
transformer Class

Show: