WPILibC++ 2024.3.2
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
9namespace 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 */
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 */
29
30 private:
31 const char* m_widgetName;
32};
33
34} // namespace frc
Represents the type of a widget in Shuffleboard.
Definition: WidgetType.h:18
std::string_view GetWidgetName() const
Gets the string type of the widget as defined by that widget in Shuffleboard.
~WidgetType()=default
constexpr WidgetType(const char *widgetName)
Definition: WidgetType.h:20
basic_string_view< char > string_view
Definition: core.h:501
Definition: AprilTagPoseEstimator.h:15