Compartir a través de


choice::choice Constructor

Constructs a choice messaging block.

explicit choice(
   _Type _Tuple
);

choice(
   Scheduler& _PScheduler,
   _Type _Tuple
);

choice(
   ScheduleGroup& _PScheduleGroup,
   _Type _Tuple
);

choice(
   choice && _Choice
);

Parameters

  • _Tuple
    A tuple of sources for the choice.

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

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

  • _Choice
    A choice messaging block to copy from. Note that the original object is orphaned, making this a move constructor.

Remarks

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

Move construction is not performed under a lock, which means that it is up to the user to make sure that there are no light-weight tasks in flight at the time of moving. Otherwise, numerous races can occur, leading to exceptions or inconsistent state.

Requirements

Header: agents.h

Namespace: concurrency

See Also

Reference

choice Class

Scheduler Class

ScheduleGroup Class