WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
SendableChooserSim.hpp
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 <string_view>
8
12
13namespace wpi::sim {
14
15/**
16 * Class that facilitates control of a SendableChooser's selected option in
17 * simulation.
18 */
20 public:
21 /**
22 * Constructs a SendableChooserSim.
23 *
24 * @param path The path where the SendableChooser is published.
25 */
26 explicit SendableChooserSim(std::string_view path);
27
28 /**
29 * Constructs a SendableChooserSim.
30 *
31 * @param inst The NetworkTables instance.
32 * @param path The path where the SendableChooser is published.
33 */
35
36 /**
37 * Set the selected option.
38 * @param option The option.
39 */
40 void SetSelected(std::string_view option);
41
42 private:
43 wpi::nt::StringPublisher m_publisher;
44};
45} // namespace wpi::sim
NetworkTables Instance.
Definition NetworkTableInstance.hpp:67
NetworkTables String publisher.
Definition StringTopic.hpp:184
void SetSelected(std::string_view option)
Set the selected option.
SendableChooserSim(wpi::nt::NetworkTableInstance inst, std::string_view path)
Constructs a SendableChooserSim.
SendableChooserSim(std::string_view path)
Constructs a SendableChooserSim.
Definition CTREPCMSim.hpp:13