Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wpilib] Add SmartDashboard::PutData() reference overload #7361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ void SmartDashboard::PutData(wpi::Sendable* value) {
}
}

void SmartDashboard::PutData(std::string_view key, wpi::Sendable& data) {
PutData(key, &data);
}

void SmartDashboard::PutData(wpi::Sendable& value) {
PutData(&value);
}

wpi::Sendable* SmartDashboard::GetData(std::string_view key) {
auto& inst = GetInstance();
std::scoped_lock lock(inst.tablesToDataMutex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,34 @@ class SmartDashboard {
*/
static void PutData(wpi::Sendable* value);

/**
* Maps the specified key to the specified value in this table.
*
* The value can be retrieved by calling the get method with a key that is
* equal to the original key.
*
* In order for the value to appear in the dashboard, it must be registered
* with SendableRegistry. WPILib components do this automatically.
*
* @param key the key
* @param data the value
*/
static void PutData(std::string_view key, wpi::Sendable& data);

/**
* Maps the specified key (where the key is the name of the Sendable)
* to the specified value in this table.
*
* The value can be retrieved by calling the get method with a key that is
* equal to the original key.
*
* In order for the value to appear in the dashboard, it must be registered
* with SendableRegistry. WPILib components do this automatically.
*
* @param value the value
*/
static void PutData(wpi::Sendable& value);

/**
* Returns the value at the specified key.
*
Expand Down
Loading