WPILibC++ 2024.3.2
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< Command, NotifierCommand >

Public Member Functions

 NotifierCommand (std::function< void()> toRun, units::second_t period, Requirements 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< Command, NotifierCommand >
 CommandHelper ()=default
 
CommandPtr ToPtr () &&override
 

Additional Inherited Members

- Protected Member Functions inherited from frc2::CommandHelper< Command, 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/3]

frc2::NotifierCommand::NotifierCommand ( std::function< void()>  toRun,
units::second_t  period,
Requirements  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/3]

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

◆ NotifierCommand() [3/3]

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: