WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::cmd::ParallelCommandGroup Class Reference

A command composition that runs a set of commands in parallel, ending when the last command ends. More...

#include <wpi/commands2/ParallelCommandGroup.hpp>

Inheritance diagram for wpi::cmd::ParallelCommandGroup:
wpi::cmd::CommandHelper< Command, ParallelCommandGroup >

Public Member Functions

 ParallelCommandGroup (std::vector< std::unique_ptr< Command > > &&commands)
 Creates a new ParallelCommandGroup.
template<wpi::util::DecayedDerivedFrom< Command >... Commands>
 ParallelCommandGroup (Commands &&... commands)
 Creates a new ParallelCommandGroup.
 ParallelCommandGroup (ParallelCommandGroup &&other)=default
 ParallelCommandGroup (const ParallelCommandGroup &)=delete
 ParallelCommandGroup (ParallelCommandGroup &)=delete
template<wpi::util::DecayedDerivedFrom< Command >... Commands>
void AddCommands (Commands &&... commands)
 Adds the given commands to the group.
void Initialize () final
void Execute () final
void End (bool interrupted) final
bool IsFinished () final
bool RunsWhenDisabled () const override
Command::InterruptionBehavior GetInterruptionBehavior () const override
Public Member Functions inherited from wpi::cmd::CommandHelper< Command, ParallelCommandGroup >
 CommandHelper ()=default
CommandPtr ToPtr () &&override

Detailed Description

A command composition that runs a set of commands in parallel, ending when the last command ends.

The rules for command compositions apply: command instances that are passed to it are owned by the composition and cannot be added to any other composition or scheduled individually, and the composition requires all subsystems its components require.

This class is provided by the NewCommands VendorDep

Constructor & Destructor Documentation

◆ ParallelCommandGroup() [1/5]

wpi::cmd::ParallelCommandGroup::ParallelCommandGroup ( std::vector< std::unique_ptr< Command > > && commands)
explicit

Creates a new ParallelCommandGroup.

The given commands will be executed simultaneously. The command group will finish when the last command finishes. If the composition is interrupted, only the commands that are still running will be interrupted.

Parameters
commandsthe commands to include in this composition.

◆ ParallelCommandGroup() [2/5]

template<wpi::util::DecayedDerivedFrom< Command >... Commands>
wpi::cmd::ParallelCommandGroup::ParallelCommandGroup ( Commands &&... commands)
inlineexplicit

Creates a new ParallelCommandGroup.

The given commands will be executed simultaneously. The command group will finish when the last command finishes. If the composition is interrupted, only the commands that are still running will be interrupted.

Parameters
commandsthe commands to include in this composition.

◆ ParallelCommandGroup() [3/5]

wpi::cmd::ParallelCommandGroup::ParallelCommandGroup ( ParallelCommandGroup && other)
default

◆ ParallelCommandGroup() [4/5]

wpi::cmd::ParallelCommandGroup::ParallelCommandGroup ( const ParallelCommandGroup & )
delete

◆ ParallelCommandGroup() [5/5]

wpi::cmd::ParallelCommandGroup::ParallelCommandGroup ( ParallelCommandGroup & )
delete

Member Function Documentation

◆ AddCommands()

template<wpi::util::DecayedDerivedFrom< Command >... Commands>
void wpi::cmd::ParallelCommandGroup::AddCommands ( Commands &&... commands)
inline

Adds the given commands to the group.

Parameters
commandsCommands to add to the group.

◆ End()

void wpi::cmd::ParallelCommandGroup::End ( bool interrupted)
final

◆ Execute()

void wpi::cmd::ParallelCommandGroup::Execute ( )
final

◆ GetInterruptionBehavior()

Command::InterruptionBehavior wpi::cmd::ParallelCommandGroup::GetInterruptionBehavior ( ) const
override

◆ Initialize()

void wpi::cmd::ParallelCommandGroup::Initialize ( )
final

◆ IsFinished()

bool wpi::cmd::ParallelCommandGroup::IsFinished ( )
final

◆ RunsWhenDisabled()

bool wpi::cmd::ParallelCommandGroup::RunsWhenDisabled ( ) const
override

The documentation for this class was generated from the following file: