WPILibC++ 2024.3.2
|
A command composition that runs one of a selection of commands using a selector and a key to command mapping. More...
#include <frc2/command/SelectCommand.h>
Public Member Functions | |
template<std::derived_from< Command >... Commands> | |
SelectCommand (std::function< Key()> selector, std::pair< Key, Commands >... commands) | |
Creates a new SelectCommand. More... | |
SelectCommand (std::function< Key()> selector, std::vector< std::pair< Key, std::unique_ptr< Command > > > &&commands) | |
SelectCommand (const SelectCommand &other)=delete | |
SelectCommand (SelectCommand &)=delete | |
SelectCommand (SelectCommand &&other)=default | |
void | Initialize () override |
void | Execute () override |
void | End (bool interrupted) override |
bool | IsFinished () override |
bool | RunsWhenDisabled () const override |
Command::InterruptionBehavior | GetInterruptionBehavior () const override |
void | InitSendable (wpi::SendableBuilder &builder) override |
Public Member Functions inherited from frc2::CommandHelper< Command, SelectCommand< Key > > | |
CommandHelper ()=default | |
CommandPtr | ToPtr () &&override |
Protected Member Functions | |
std::unique_ptr< Command > | TransferOwnership () &&override |
Protected Member Functions inherited from frc2::CommandHelper< Command, SelectCommand< Key > > | |
std::unique_ptr< Command > | TransferOwnership () &&override |
A command composition that runs one of a selection of commands using a selector and a key to command mapping.
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
|
inlineexplicit |
Creates a new SelectCommand.
commands | the map of commands to choose from |
selector | the selector to determine which command to run |
|
inline |
|
delete |
|
delete |
|
default |
|
inlineoverride |
|
inlineoverride |
|
inlineoverride |
|
override |
|
inlineoverride |
|
inlineoverride |
|
inlineoverride |
|
inlineoverrideprotected |