WPILibC++ 2023.4.3
NetworkButton.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 <memory>
8#include <string_view>
9
13
14#include "Button.h"
15
16namespace frc2 {
17/**
18 * A Button that uses a NetworkTable boolean field.
19 *
20 * This class is provided by the NewCommands VendorDep
21 */
22class NetworkButton : public Button {
23 public:
24 /**
25 * Creates a NetworkButton that commands can be bound to.
26 *
27 * @param topic The boolean topic that contains the value.
28 */
30
31 /**
32 * Creates a NetworkButton that commands can be bound to.
33 *
34 * @param sub The boolean subscriber that provides the value.
35 */
37
38 /**
39 * Creates a NetworkButton that commands can be bound to.
40 *
41 * @param table The table where the networktable value is located.
42 * @param field The field that is the value.
43 */
44 NetworkButton(std::shared_ptr<nt::NetworkTable> table,
45 std::string_view field);
46
47 /**
48 * Creates a NetworkButton that commands can be bound to.
49 *
50 * @param table The table where the networktable value is located.
51 * @param field The field that is the value.
52 */
54
55 /**
56 * Creates a NetworkButton that commands can be bound to.
57 *
58 * @param inst The NetworkTable instance to use
59 * @param table The table where the networktable value is located.
60 * @param field The field that is the value.
61 */
63 std::string_view field);
64};
65} // namespace frc2
A class used to bind command scheduling to button presses.
Definition: Button.h:27
A Button that uses a NetworkTable boolean field.
Definition: NetworkButton.h:22
NetworkButton(nt::BooleanTopic topic)
Creates a NetworkButton that commands can be bound to.
NetworkButton(std::string_view table, std::string_view field)
Creates a NetworkButton that commands can be bound to.
NetworkButton(nt::NetworkTableInstance inst, std::string_view table, std::string_view field)
Creates a NetworkButton that commands can be bound to.
NetworkButton(nt::BooleanSubscriber sub)
Creates a NetworkButton that commands can be bound to.
NetworkButton(std::shared_ptr< nt::NetworkTable > table, std::string_view field)
Creates a NetworkButton that commands can be bound to.
NetworkTables Boolean subscriber.
Definition: BooleanTopic.h:29
NetworkTables Boolean topic.
Definition: BooleanTopic.h:210
NetworkTables Instance.
Definition: NetworkTableInstance.h:59
basic_string_view< char > string_view
Definition: core.h:520
Definition: InstantCommand.h:14