32 requires std::copy_constructible<T> && std::default_initializable<T>
35 std::function<void(T)> m_listener;
37 static U _unwrap_smart_ptr(
const U& value);
40 static std::weak_ptr<U> _unwrap_smart_ptr(
const std::shared_ptr<U>& value);
91 void OnChange(std::function<
void(T)>);
This file defines the StringMap class.
This class is a non-template base class for SendableChooser.
Definition: SendableChooserBase.h:23
The SendableChooser class is a useful tool for presenting a selection of options to the SmartDashboar...
Definition: SendableChooser.h:33
SendableChooser & operator=(SendableChooser &&rhs)=default
CopyType GetSelected() const
Returns a copy of the selected option (a std::weak_ptr<U> if T = std::shared_ptr<U>).
Definition: SendableChooser.inc:36
SendableChooser(SendableChooser &&rhs)=default
void AddOption(std::string_view name, T object)
Adds the given object to the list of options.
Definition: SendableChooser.inc:23
void InitSendable(wpi::SendableBuilder &builder) override
Initializes this Sendable object.
Definition: SendableChooser.inc:60
~SendableChooser() override=default
void OnChange(std::function< void(T)>)
Bind a listener that's called when the selected value changes.
Definition: SendableChooser.inc:53
void SetDefaultOption(std::string_view name, T object)
Add the given object to the list of options and marks it as the default.
Definition: SendableChooser.inc:29
SendableChooser()=default
decltype(_unwrap_smart_ptr(m_choices.lookup(""))) CopyType
Definition: SendableChooser.h:43
Helper class for building Sendable dashboard representations.
Definition: SendableBuilder.h:21
ValueTy lookup(std::string_view Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: StringMap.h:238
basic_string_view< char > string_view
Definition: core.h:501
Definition: AprilTagPoseEstimator.h:15