13 #include <llvm/StringMap.h> 14 #include <llvm/StringRef.h> 16 #include "SmartDashboard/SendableChooserBase.h" 17 #include "networktables/NetworkTable.h" 18 #include "networktables/NetworkTableEntry.h" 42 static U _unwrap_smart_ptr(
const U& value);
45 static U* _unwrap_smart_ptr(
const std::unique_ptr<U>& value);
48 static std::weak_ptr<U> _unwrap_smart_ptr(
const std::shared_ptr<U>& value);
56 auto GetSelected() -> decltype(_unwrap_smart_ptr(m_choices[
""]));
58 void InitTable(std::shared_ptr<nt::NetworkTable> subtable)
override;
63 #include "SendableChooser.inc"
This class is a non-template base class for SendableChooser.
Definition: SendableChooserBase.h:24
void AddObject(llvm::StringRef name, T object)
Adds the given object to the list of options.
Definition: SendableChooser.inc:28
auto GetSelected() -> decltype(_unwrap_smart_ptr(m_choices[""]))
Returns a copy of the selected option (a raw pointer U* if T = std::unique_ptr<U> or a std::weak_ptr<...
Definition: SendableChooser.inc:60
void AddDefault(llvm::StringRef name, T object)
Add the given object to the list of options and marks it as the default.
Definition: SendableChooser.inc:43
The SendableChooser class is a useful tool for presenting a selection of options to the SmartDashboar...
Definition: SendableChooser.h:37
NetworkTables Entry.
Definition: NetworkTableEntry.h:30
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42
void InitTable(std::shared_ptr< nt::NetworkTable > subtable) override
Initializes a table for this sendable object.
Definition: SendableChooser.inc:71