WPILibC++  2019.1.1-beta-4-19-ge1bf623
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
SendableChooserBase.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-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 <atomic>
11 #include <string>
12 
13 #include <networktables/NetworkTableEntry.h>
14 #include <wpi/SmallVector.h>
15 #include <wpi/mutex.h>
16 
17 #include "frc/smartdashboard/SendableBase.h"
18 
19 namespace frc {
20 
28  public:
30  ~SendableChooserBase() override = default;
31 
33  SendableChooserBase& operator=(SendableChooserBase&&) = default;
34 
35  protected:
36  static constexpr const char* kDefault = "default";
37  static constexpr const char* kOptions = "options";
38  static constexpr const char* kSelected = "selected";
39  static constexpr const char* kActive = "active";
40  static constexpr const char* kInstance = ".instance";
41 
42  std::string m_defaultChoice;
43  std::string m_selected;
44  bool m_haveSelected = false;
46  wpi::mutex m_mutex;
47  int m_instance;
48  static std::atomic_int s_instances;
49 };
50 
51 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
This class is a non-template base class for SendableChooser.
Definition: SendableChooserBase.h:27
Definition: SendableBase.h:19