mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Adds SetDefault methods to NetworkTables (#54)
There was no way to atomically check for a key in the table, and then setting if it if non existant. Back before persistent this was not a problem, however now it is, as its possible for values to be added before team's robot programs start. This makes the old method of calling Put*** methods in RobotInit invalid. This adds SetDefault methods, which do this atomically.
This commit is contained in:
committed by
Peter Johnson
parent
6615a34e99
commit
58092c5190
@@ -29,6 +29,10 @@ std::shared_ptr<Value> GetEntryValue(StringRef name) {
|
||||
return Storage::GetInstance().GetEntryValue(name);
|
||||
}
|
||||
|
||||
bool SetDefaultEntryValue(StringRef name, std::shared_ptr<Value> value) {
|
||||
return Storage::GetInstance().SetDefaultEntryValue(name, value);
|
||||
}
|
||||
|
||||
bool SetEntryValue(StringRef name, std::shared_ptr<Value> value) {
|
||||
return Storage::GetInstance().SetEntryValue(name, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user