共用方式為


make_choice Function

Constructs a choice messaging block from an optional Scheduler or ScheduleGroup and two or more input sources.

template<
   typename _Type1,
   typename _Type2,
   typename... _Types
>
choice<std::tuple<_Type1, _Type2, _Types...>> make_choice(
   Scheduler& _PScheduler,
   _Type1_Item1,
   _Type2_Item2,
   _Types... _Items
);

template<
   typename _Type1,
   typename _Type2,
   typename... _Types
>
choice<std::tuple<_Type1, _Type2, _Types...>> make_choice(
   ScheduleGroup& _PScheduleGroup,
   _Type1_Item1,
   _Type2_Item2,
   _Types... _Items
);

template<
   typename _Type1,
   typename _Type2,
   typename... _Types
>
choice<std::tuple<_Type1, _Type2, _Types...>> make_choice(
   _Type1_Item1,
   _Type2_Item2,
   _Types... _Items
);

Parameters

  • _Type1
    The message block type of the first source.

  • _Type2
    The message block type of the second source.

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

  • _Item1
    The first source.

  • _Item2
    The second source.

  • _Items
    Additional sources.

  • _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.

Return Value

A choice message block with two or more input sources.

Requirements

Header: agents.h

Namespace: concurrency

See Also

Reference

concurrency Namespace

choice Class

Scheduler Class

ScheduleGroup Class