WPILibC++ 2023.4.3-108-ge5452e3
frc2::NotifierCommand Class Reference

A command that starts a notifier to run the given runnable periodically in a separate thread. More...

#include <frc2/command/NotifierCommand.h>

Inheritance diagram for frc2::NotifierCommand:
frc2::CommandHelper< CommandBase, NotifierCommand >

Public Member Functions

 NotifierCommand (std::function< void()> toRun, units::second_t period, std::initializer_list< Subsystem * > requirements)
 Creates a new NotifierCommand. More...
 
 NotifierCommand (std::function< void()> toRun, units::second_t period, std::span< Subsystem *const > requirements={})
 Creates a new NotifierCommand. More...
 
 NotifierCommand (NotifierCommand &&other)
 
 NotifierCommand (const NotifierCommand &other)
 
void Initialize () override
 
void End (bool interrupted) override
 
- Public Member Functions inherited from frc2::CommandHelper< CommandBase, NotifierCommand >
 CommandHelper ()=default
 
CommandPtr ToPtr () &&override
 

Additional Inherited Members

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

Detailed Description

A command that starts a notifier to run the given runnable periodically in a separate thread.

Has no end condition as-is; either subclass it or use Command::WithTimeout(double) or Command::Until(BooleanSupplier) to give it one.

WARNING: Do not use this class unless you are confident in your ability to make the executed code thread-safe. If you do not know what "thread-safe" means, that is a good sign that you should not use this class.

This class is provided by the NewCommands VendorDep

Constructor & Destructor Documentation

◆ NotifierCommand() [1/4]

frc2::NotifierCommand::NotifierCommand ( std::function< void()>  toRun,
units::second_t  period,
std::initializer_list< Subsystem * >  requirements 
)

Creates a new NotifierCommand.

Parameters
toRunthe runnable for the notifier to run
periodthe period at which the notifier should run
requirementsthe subsystems required by this command

◆ NotifierCommand() [2/4]

frc2::NotifierCommand::NotifierCommand ( std::function< void()>  toRun,
units::second_t  period,
std::span< Subsystem *const >  requirements = {} 
)

Creates a new NotifierCommand.

Parameters
toRunthe runnable for the notifier to run
periodthe period at which the notifier should run
requirementsthe subsystems required by this command

◆ NotifierCommand() [3/4]

frc2::NotifierCommand::NotifierCommand ( NotifierCommand &&  other)

◆ NotifierCommand() [4/4]

frc2::NotifierCommand::NotifierCommand ( const NotifierCommand other)

Member Function Documentation

◆ End()

void frc2::NotifierCommand::End ( bool  interrupted)
override

◆ Initialize()

void frc2::NotifierCommand::Initialize ( )
override

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