WPILibC++ 2024.3.2
frc2::ParallelDeadlineGroup Class Reference

A command composition that runs a set of commands in parallel, ending only when a specific command (the "deadline") ends, interrupting all other commands that are still running at that point. More...

#include <frc2/command/ParallelDeadlineGroup.h>

Inheritance diagram for frc2::ParallelDeadlineGroup:
frc2::CommandHelper< Command, ParallelDeadlineGroup >

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from frc2::CommandHelper< Command, ParallelDeadlineGroup >
std::unique_ptr< CommandTransferOwnership () &&override
 

Detailed Description

A command composition that runs a set of commands in parallel, ending only when a specific command (the "deadline") ends, interrupting all other commands that are still running at that point.

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

◆ ParallelDeadlineGroup() [1/5]

frc2::ParallelDeadlineGroup::ParallelDeadlineGroup ( std::unique_ptr< Command > &&  deadline,
std::vector< std::unique_ptr< Command > > &&  commands 
)

Creates a new ParallelDeadlineGroup.

The given commands (including the deadline) will be executed simultaneously. The composition will finish when the deadline finishes, interrupting all other still-running commands. If the composition is interrupted, only the commands still running will be interrupted.

Parameters
deadlinethe command that determines when the composition ends
commandsthe commands to be executed

◆ ParallelDeadlineGroup() [2/5]

frc2::ParallelDeadlineGroup::ParallelDeadlineGroup ( T &&  deadline,
Commands &&...  commands 
)
inlineexplicit

Creates a new ParallelDeadlineGroup.

The given commands (including the deadline) will be executed simultaneously. The composition will finish when the deadline finishes, interrupting all other still-running commands. If the composition is interrupted, only the commands still running will be interrupted.

Parameters
deadlinethe command that determines when the composition ends
commandsthe commands to be executed

◆ ParallelDeadlineGroup() [3/5]

frc2::ParallelDeadlineGroup::ParallelDeadlineGroup ( ParallelDeadlineGroup &&  other)
default

◆ ParallelDeadlineGroup() [4/5]

frc2::ParallelDeadlineGroup::ParallelDeadlineGroup ( const ParallelDeadlineGroup )
delete

◆ ParallelDeadlineGroup() [5/5]

frc2::ParallelDeadlineGroup::ParallelDeadlineGroup ( ParallelDeadlineGroup )
delete

Member Function Documentation

◆ AddCommands()

template<wpi::DecayedDerivedFrom< Command >... Commands>
void frc2::ParallelDeadlineGroup::AddCommands ( Commands &&...  commands)
inline

Adds the given commands to the group.

Parameters
commandsCommands to add to the group.

◆ End()

void frc2::ParallelDeadlineGroup::End ( bool  interrupted)
final

◆ Execute()

void frc2::ParallelDeadlineGroup::Execute ( )
final

◆ GetInterruptionBehavior()

Command::InterruptionBehavior frc2::ParallelDeadlineGroup::GetInterruptionBehavior ( ) const
override

◆ Initialize()

void frc2::ParallelDeadlineGroup::Initialize ( )
final

◆ InitSendable()

void frc2::ParallelDeadlineGroup::InitSendable ( wpi::SendableBuilder builder)
override

◆ IsFinished()

bool frc2::ParallelDeadlineGroup::IsFinished ( )
final

◆ RunsWhenDisabled()

bool frc2::ParallelDeadlineGroup::RunsWhenDisabled ( ) const
override

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