WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
NetworkButton.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 <memory>
8#include <string_view>
9
14
15namespace wpi::cmd {
16/**
17 * A Button that uses a NetworkTable boolean field.
18 *
19 * This class is provided by the NewCommands VendorDep
20 */
21class NetworkButton : public Trigger {
22 public:
23 /**
24 * Creates a NetworkButton that commands can be bound to.
25 *
26 * @param topic The boolean topic that contains the value.
27 */
29
30 /**
31 * Creates a NetworkButton that commands can be bound to.
32 *
33 * @param sub The boolean subscriber that provides the value.
34 */
36
37 /**
38 * Creates a NetworkButton that commands can be bound to.
39 *
40 * @param table The table where the networktable value is located.
41 * @param field The field that is the value.
42 */
43 NetworkButton(std::shared_ptr<wpi::nt::NetworkTable> table,
44 std::string_view field);
45
46 /**
47 * Creates a NetworkButton that commands can be bound to.
48 *
49 * @param table The table where the networktable value is located.
50 * @param field The field that is the value.
51 */
52 NetworkButton(std::string_view table, std::string_view field);
53
54 /**
55 * Creates a NetworkButton that commands can be bound to.
56 *
57 * @param inst The NetworkTable instance to use
58 * @param table The table where the networktable value is located.
59 * @param field The field that is the value.
60 */
61 NetworkButton(wpi::nt::NetworkTableInstance inst, std::string_view table,
62 std::string_view field);
63};
64} // namespace wpi::cmd
NetworkButton(std::string_view table, std::string_view field)
Creates a NetworkButton that commands can be bound to.
NetworkButton(wpi::nt::BooleanTopic topic)
Creates a NetworkButton that commands can be bound to.
NetworkButton(wpi::nt::NetworkTableInstance inst, std::string_view table, std::string_view field)
Creates a NetworkButton that commands can be bound to.
NetworkButton(wpi::nt::BooleanSubscriber sub)
Creates a NetworkButton that commands can be bound to.
NetworkButton(std::shared_ptr< wpi::nt::NetworkTable > table, std::string_view field)
Creates a NetworkButton that commands can be bound to.
Trigger(std::function< bool()> condition)
Creates a new trigger based on the given condition.
Definition Trigger.hpp:40
NetworkTables Boolean subscriber.
Definition BooleanTopic.hpp:34
NetworkTables Boolean topic.
Definition BooleanTopic.hpp:235
NetworkTables Instance.
Definition NetworkTableInstance.hpp:67
Definition CommandNiDsStadiaController.hpp:15