[ntcore] NetworkTables 4 (#3217)

This commit is contained in:
Peter Johnson
2022-10-08 10:01:31 -07:00
committed by GitHub
parent 90cfa00115
commit 77301b126c
380 changed files with 34573 additions and 22095 deletions

View File

@@ -5,10 +5,11 @@
#pragma once
#include <memory>
#include <string>
#include <string_view>
#include <networktables/GenericEntry.h>
#include <networktables/NetworkTable.h>
#include <networktables/NetworkTableEntry.h>
#include "frc/shuffleboard/ShuffleboardWidget.h"
@@ -26,14 +27,24 @@ class SimpleWidget final : public ShuffleboardWidget<SimpleWidget> {
/**
* Gets the NetworkTable entry that contains the data for this widget.
* The widget owns the entry.
*/
nt::NetworkTableEntry GetEntry();
nt::GenericEntry& GetEntry();
/**
* Gets the NetworkTable entry that contains the data for this widget.
* The widget owns the entry.
*
* @param typeString NT type string
*/
nt::GenericEntry& GetEntry(std::string_view typeString);
void BuildInto(std::shared_ptr<nt::NetworkTable> parentTable,
std::shared_ptr<nt::NetworkTable> metaTable) override;
private:
nt::NetworkTableEntry m_entry;
nt::GenericEntry m_entry;
std::string m_typeString;
void ForceGenerate();
};