WPILibC++  2019.2.1-17-g6992f54
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
ShuffleboardComponent.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 
13 #include <networktables/NetworkTable.h>
14 #include <networktables/NetworkTableValue.h>
15 #include <wpi/StringMap.h>
16 #include <wpi/Twine.h>
17 
18 #include "frc/shuffleboard/ShuffleboardComponentBase.h"
19 
20 namespace frc {
21 
22 class ShuffleboardContainer;
23 
29 template <typename Derived>
31  public:
33  const wpi::Twine& type = "");
34 
35  virtual ~ShuffleboardComponent() = default;
36 
45  Derived& WithProperties(
46  const wpi::StringMap<std::shared_ptr<nt::Value>>& properties);
47 
61  Derived& WithPosition(int columnIndex, int rowIndex);
62 
71  Derived& WithSize(int width, int height);
72 };
73 
74 } // namespace frc
75 
76 #include "frc/shuffleboard/ShuffleboardComponent.inc"
A shim class to allow storing ShuffleboardComponents in arrays.
Definition: ShuffleboardComponentBase.h:27
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
A generic component in Shuffleboard.
Definition: ShuffleboardComponent.h:30
Derived & WithProperties(const wpi::StringMap< std::shared_ptr< nt::Value >> &properties)
Sets custom properties for this component.
Definition: ShuffleboardComponent.inc:23
Derived & WithPosition(int columnIndex, int rowIndex)
Sets the position of this component in the tab.
Definition: ShuffleboardComponent.inc:31
Derived & WithSize(int width, int height)
Sets the size of this component in the tab.
Definition: ShuffleboardComponent.inc:40
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:205
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
Common interface for objects that can contain shuffleboard components.
Definition: ShuffleboardContainer.h:41