source_block::accept Method

source_block::accept Method

Accepts a message that was offered by this source_block object, transferring ownership to the caller.

virtual message<_Target_type> * accept(
   runtime_object_identity _MsgId,
   ITarget<_Target_type> * _PTarget


The runtime_object_identity of the offered message object.


A pointer to the target block that is calling the accept method.

A pointer to the message object that the caller now has ownership of.

The method throws an invalid_argument exception if the parameter _PTarget is NULL.

The accept method is called by a target while a message is being offered by this ISource block. The message pointer returned may be different from the one passed into the propagate method of the ITarget block, if this source decides to make a copy of the message.

Header: agents.h

Namespace: Concurrency

Community Additions

© 2016 Microsoft