Share via

ISource::consume Method

When overridden in a derived class, consumes a message previously offered by this ISource block and successfully reserved by the target, transferring ownership to the caller.

virtual message<_Type> * consume(
   runtime_object_identity _MsgId,
   ITarget<_Type> * _PTarget
) = 0;


  • _MsgId
    The runtime_object_identity of the reserved message object.

  • _PTarget
    A pointer to the target block that is calling the consume method.

Return Value

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


The consume method is similar to accept, but must always be preceded by a call to reserve that returned true.


Header: agents.h

Namespace: Concurrency

See Also


ISource Class