32 static_assert(std::is_copy_constructible_v<T>,
33 "T must be copy-constructible!");
34 static_assert(std::is_default_constructible_v<T>,
35 "T must be default-constructible!");
38 static U _unwrap_smart_ptr(
const U&
value);
41 static U* _unwrap_smart_ptr(
const std::unique_ptr<U>&
value);
44 static std::weak_ptr<U> _unwrap_smart_ptr(
const std::shared_ptr<U>&
value);
85 auto GetSelected() ->
decltype(_unwrap_smart_ptr(m_choices[
""]));
This file defines the StringMap class.
This class is a non-template base class for SendableChooser.
Definition: SendableChooserBase.h:26
The SendableChooser class is a useful tool for presenting a selection of options to the SmartDashboar...
Definition: SendableChooser.h:30
SendableChooser & operator=(SendableChooser &&rhs)=default
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:26
SendableChooser(SendableChooser &&rhs)=default
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:32
~SendableChooser() override=default
void AddOption(std::string_view name, T object)
Adds the given object to the list of options.
Definition: SendableChooser.inc:21
SendableChooser()=default
void InitSendable(nt::NTSendableBuilder &builder) override
Initializes this Sendable object.
Definition: SendableChooser.inc:49
Definition: NTSendableBuilder.h:18
basic_string_view< char > string_view
Definition: core.h:520
Definition: AprilTagFieldLayout.h:22