This documentation is archived and is not being maintained.

source_block::reserve Method

Reserves a message previously offered by this source_block object.

virtual bool reserve(
   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 reserve method.

true if the message was successfully reserved, false otherwise. Reservations can fail for many reasons, including: the message was already reserved or accepted by another target, the source could deny reservations, etc.

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

After you call reserve, if it succeeds, you must call either consume or release in order to take or give up possession of the message, respectively.

Header: agents.h

Namespace: Concurrency