WPILibC++ 2024.3.2
DriverStationModeThread.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <atomic>
8#include <thread>
9
10namespace frc::internal {
11/**
12 * For internal use only.
13 */
15 public:
16 /**
17 * For internal use only.
18 */
20
22
26 delete;
28
29 /**
30 * Only to be used to tell the Driver Station what code you claim to be
31 * executing for diagnostic purposes only.
32 *
33 * @param entering If true, starting disabled code; if false, leaving disabled
34 * code
35 */
36 void InDisabled(bool entering);
37
38 /**
39 * Only to be used to tell the Driver Station what code you claim to be
40 * executing for diagnostic purposes only.
41 *
42 * @param entering If true, starting autonomous code; if false, leaving
43 * autonomous code
44 */
45 void InAutonomous(bool entering);
46
47 /**
48 * Only to be used to tell the Driver Station what code you claim to be
49 * executing for diagnostic purposes only.
50 *
51 * @param entering If true, starting teleop code; if false, leaving teleop
52 * code
53 */
54 void InTeleop(bool entering);
55
56 /**
57 * Only to be used to tell the Driver Station what code you claim to be
58 * executing for diagnostic purposes only.
59 *
60 * @param entering If true, starting test code; if false, leaving test code
61 */
62 void InTest(bool entering);
63
64 private:
65 std::atomic_bool m_keepAlive{false};
66 std::thread m_thread;
67 void Run();
68 bool m_userInDisabled{false};
69 bool m_userInAutonomous{false};
70 bool m_userInTeleop{false};
71 bool m_userInTest{false};
72};
73} // namespace frc::internal
For internal use only.
Definition: DriverStationModeThread.h:14
void InDisabled(bool entering)
Only to be used to tell the Driver Station what code you claim to be executing for diagnostic purpose...
DriverStationModeThread(DriverStationModeThread &&other)=delete
DriverStationModeThread & operator=(DriverStationModeThread &&other)=delete
DriverStationModeThread & operator=(const DriverStationModeThread &other)=delete
void InTest(bool entering)
Only to be used to tell the Driver Station what code you claim to be executing for diagnostic purpose...
DriverStationModeThread(const DriverStationModeThread &other)=delete
void InTeleop(bool entering)
Only to be used to tell the Driver Station what code you claim to be executing for diagnostic purpose...
DriverStationModeThread()
For internal use only.
void InAutonomous(bool entering)
Only to be used to tell the Driver Station what code you claim to be executing for diagnostic purpose...
Definition: DriverStationModeThread.h:10