WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::cmd::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 <wpi/commands2/ParallelDeadlineGroup.hpp>

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

Public Member Functions

 ParallelDeadlineGroup (std::unique_ptr< Command > &&deadline, std::vector< std::unique_ptr< Command > > &&commands)
 Creates a new ParallelDeadlineGroup.
template<wpi::util::DecayedDerivedFrom< Command > T, wpi::util::DecayedDerivedFrom< Command >... Commands>
 ParallelDeadlineGroup (T &&deadline, Commands &&... commands)
 Creates a new ParallelDeadlineGroup.
 ParallelDeadlineGroup (ParallelDeadlineGroup &&other)=default
 ParallelDeadlineGroup (const ParallelDeadlineGroup &)=delete
 ParallelDeadlineGroup (ParallelDeadlineGroup &)=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
void InitSendable (wpi::util::SendableBuilder &builder) override
Public Member Functions inherited from wpi::cmd::CommandHelper< Command, ParallelDeadlineGroup >
 CommandHelper ()=default
CommandPtr ToPtr () &&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]

wpi::cmd::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]

wpi::cmd::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]

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

◆ ParallelDeadlineGroup() [4/5]

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

◆ ParallelDeadlineGroup() [5/5]

wpi::cmd::ParallelDeadlineGroup::ParallelDeadlineGroup ( ParallelDeadlineGroup & )
delete

Member Function Documentation

◆ AddCommands()

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

Adds the given commands to the group.

Parameters
commandsCommands to add to the group.

◆ End()

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

◆ Execute()

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

◆ GetInterruptionBehavior()

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

◆ Initialize()

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

◆ InitSendable()

void wpi::cmd::ParallelDeadlineGroup::InitSendable ( wpi::util::SendableBuilder & builder)
override

◆ IsFinished()

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

◆ RunsWhenDisabled()

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

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