WPILibC++ 2023.4.3-108-ge5452e3
ShuffleboardComponentBase.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
13#include <wpi/StringMap.h>
14
16
17namespace frc {
18
19class ShuffleboardContainer;
20
21/**
22 * A shim class to allow storing ShuffleboardComponents in arrays.
23 */
25 public:
28
30
31 void BuildMetadata(std::shared_ptr<nt::NetworkTable> metaTable);
32
34
35 const std::string& GetType() const;
36
37 protected:
39 bool m_metadataDirty = true;
40 int m_column = -1;
41 int m_row = -1;
42 int m_width = -1;
43 int m_height = -1;
44
45 private:
46 ShuffleboardContainer& m_parent;
47 std::string m_type;
48
49 /**
50 * Gets the custom properties for this component. May be null.
51 */
52 const wpi::StringMap<nt::Value>& GetProperties() const;
53};
54
55} // namespace frc
This file defines the StringMap class.
A shim class to allow storing ShuffleboardComponents in arrays.
Definition: ShuffleboardComponentBase.h:24
int m_width
Definition: ShuffleboardComponentBase.h:42
wpi::StringMap< nt::Value > m_properties
Definition: ShuffleboardComponentBase.h:38
ShuffleboardComponentBase(ShuffleboardContainer &parent, std::string_view title, std::string_view type="")
bool m_metadataDirty
Definition: ShuffleboardComponentBase.h:39
int m_height
Definition: ShuffleboardComponentBase.h:43
int m_row
Definition: ShuffleboardComponentBase.h:41
void SetType(std::string_view type)
void BuildMetadata(std::shared_ptr< nt::NetworkTable > metaTable)
ShuffleboardContainer & GetParent()
int m_column
Definition: ShuffleboardComponentBase.h:40
const std::string & GetType() const
Common interface for objects that can contain shuffleboard components.
Definition: ShuffleboardContainer.h:42
Definition: ShuffleboardValue.h:15
basic_string_view< char > string_view
Definition: core.h:520
type
Definition: core.h:575
Definition: AprilTagPoseEstimator.h:15