WPILibC++
2025.2.1
Loading...
Searching...
No Matches
WidgetType.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 <string_view>
8
9
namespace
frc
{
10
11
/**
12
* Represents the type of a widget in Shuffleboard. Using this is preferred over
13
* specifying raw strings, to avoid typos and having to know or look up the
14
* exact string name for a desired widget.
15
*
16
* @see BuiltInWidgets the built-in widget types
17
*/
18
class
WidgetType
{
19
public
:
20
explicit
constexpr
WidgetType
(
const
char
* widgetName)
21
: m_widgetName(widgetName) {}
22
~WidgetType
() =
default
;
23
24
/**
25
* Gets the string type of the widget as defined by that widget in
26
* Shuffleboard.
27
*/
28
std::string_view
GetWidgetName
()
const
;
29
30
private
:
31
const
char
* m_widgetName;
32
};
33
34
}
// namespace frc
frc::WidgetType
Represents the type of a widget in Shuffleboard.
Definition
WidgetType.h:18
frc::WidgetType::GetWidgetName
std::string_view GetWidgetName() const
Gets the string type of the widget as defined by that widget in Shuffleboard.
frc::WidgetType::~WidgetType
~WidgetType()=default
frc::WidgetType::WidgetType
constexpr WidgetType(const char *widgetName)
Definition
WidgetType.h:20
frc
Definition
CAN.h:11
frc
shuffleboard
WidgetType.h
Generated on Fri Jan 10 2025 07:37:19 for WPILibC++ by
1.12.0