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:
Thad House
2016-07-13 00:31:03 -07:00
committed by Peter Johnson
parent 6615a34e99
commit 58092c5190
15 changed files with 785 additions and 1 deletions

View File

@@ -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);
}