WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::OpMode Class Referenceabstract

Top-level interface for opmode classes. More...

#include <wpi/opmode/OpMode.hpp>

Inheritance diagram for wpi::OpMode:
wpi::PeriodicOpMode

Public Member Functions

virtual ~OpMode ()=default
 The object is destroyed when the opmode is no longer selected on the DS or after OpModeRun() returns.
virtual void DisabledPeriodic ()
 This function is called periodically while the opmode is selected on the DS (robot is disabled).
virtual void OpModeRun (int64_t opModeId)=0
 This function is called when the opmode starts (robot is enabled).
virtual void OpModeStop ()=0
 This function is called asynchronously when the robot is disabled, to request the opmode return from OpModeRun().

Detailed Description

Top-level interface for opmode classes.

Users should generally extend one of the abstract implementations of this interface (e.g. PeriodicOpMode) rather than directly implementing this interface.

Constructor & Destructor Documentation

◆ ~OpMode()

virtual wpi::OpMode::~OpMode ( )
virtualdefault

The object is destroyed when the opmode is no longer selected on the DS or after OpModeRun() returns.

Member Function Documentation

◆ DisabledPeriodic()

virtual void wpi::OpMode::DisabledPeriodic ( )
inlinevirtual

This function is called periodically while the opmode is selected on the DS (robot is disabled).

Code that should only run once when the opmode is selected should go in the opmode constructor.

Reimplemented in wpi::PeriodicOpMode.

◆ OpModeRun()

virtual void wpi::OpMode::OpModeRun ( int64_t opModeId)
pure virtual

This function is called when the opmode starts (robot is enabled).

Parameters
opModeIdopmode unique ID

Implemented in wpi::PeriodicOpMode.

◆ OpModeStop()

virtual void wpi::OpMode::OpModeStop ( )
pure virtual

This function is called asynchronously when the robot is disabled, to request the opmode return from OpModeRun().

Implemented in wpi::PeriodicOpMode.


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