Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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,
   _Inout_ 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

© 2015 Microsoft