[wpilibc] Shuffleboard SimpleWidget: Return pointer instead of reference (#4703)

Based on beta test feedback, returning a pointer is more intuitive, as
typically the return value is late bound to an instance variable.
This commit is contained in:
Peter Johnson
2022-11-24 09:05:37 -08:00
committed by GitHub
parent e15200068d
commit 34ec89c041
5 changed files with 35 additions and 33 deletions

View File

@@ -27,17 +27,19 @@ class SimpleWidget final : public ShuffleboardWidget<SimpleWidget> {
/**
* Gets the NetworkTable entry that contains the data for this widget.
* The widget owns the entry.
* The widget owns the entry; the returned pointer's lifetime is the same as
* that of the widget.
*/
nt::GenericEntry& GetEntry();
nt::GenericEntry* GetEntry();
/**
* Gets the NetworkTable entry that contains the data for this widget.
* The widget owns the entry.
* The widget owns the entry; the returned pointer's lifetime is the same as
* that of the widget.
*
* @param typeString NT type string
*/
nt::GenericEntry& GetEntry(std::string_view typeString);
nt::GenericEntry* GetEntry(std::string_view typeString);
void BuildInto(std::shared_ptr<nt::NetworkTable> parentTable,
std::shared_ptr<nt::NetworkTable> metaTable) override;