WPILibC++
2024.3.2
SimpleWidget.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>
9
#include <string_view>
10
11
#include <
networktables/GenericEntry.h
>
12
#include <
networktables/NetworkTable.h
>
13
14
#include "
frc/shuffleboard/ShuffleboardWidget.h
"
15
16
namespace
frc
{
17
18
class
ShuffleboardContainer;
19
20
/**
21
* A Shuffleboard widget that handles a single data point such as a number or
22
* string.
23
*/
24
class
SimpleWidget
final :
public
ShuffleboardWidget
<SimpleWidget> {
25
public
:
26
SimpleWidget
(
ShuffleboardContainer
& parent,
std::string_view
title);
27
28
/**
29
* Gets the NetworkTable entry that contains the data for this widget.
30
* The widget owns the entry; the returned pointer's lifetime is the same as
31
* that of the widget.
32
*/
33
nt::GenericEntry
*
GetEntry
();
34
35
/**
36
* Gets the NetworkTable entry that contains the data for this widget.
37
* The widget owns the entry; the returned pointer's lifetime is the same as
38
* that of the widget.
39
*
40
* @param typeString NT type string
41
*/
42
nt::GenericEntry
*
GetEntry
(
std::string_view
typeString);
43
44
void
BuildInto
(std::shared_ptr<nt::NetworkTable> parentTable,
45
std::shared_ptr<nt::NetworkTable> metaTable)
override
;
46
47
private
:
48
nt::GenericEntry
m_entry;
49
std::string m_typeString;
50
51
void
ForceGenerate();
52
};
53
54
}
// namespace frc
GenericEntry.h
NetworkTable.h
ShuffleboardWidget.h
frc::ShuffleboardContainer
Common interface for objects that can contain shuffleboard components.
Definition:
ShuffleboardContainer.h:42
frc::ShuffleboardWidget
Abstract superclass for widgets.
Definition:
ShuffleboardWidget.h:29
frc::SimpleWidget
A Shuffleboard widget that handles a single data point such as a number or string.
Definition:
SimpleWidget.h:24
frc::SimpleWidget::GetEntry
nt::GenericEntry * GetEntry(std::string_view typeString)
Gets the NetworkTable entry that contains the data for this widget.
frc::SimpleWidget::SimpleWidget
SimpleWidget(ShuffleboardContainer &parent, std::string_view title)
frc::SimpleWidget::GetEntry
nt::GenericEntry * GetEntry()
Gets the NetworkTable entry that contains the data for this widget.
frc::SimpleWidget::BuildInto
void BuildInto(std::shared_ptr< nt::NetworkTable > parentTable, std::shared_ptr< nt::NetworkTable > metaTable) override
Builds the entries for this value.
nt::GenericEntry
NetworkTables generic entry.
Definition:
GenericEntry.h:435
string_view
basic_string_view< char > string_view
Definition:
core.h:501
frc
Definition:
AprilTagPoseEstimator.h:15
frc
shuffleboard
SimpleWidget.h
Generated on Wed Mar 13 2024 05:20:40 for WPILibC++ by
1.9.4