mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Implement local notification.
The default behavior is to only notify remote changes, but for some applications (e.g. GUI's) it's advantageous to know about local changes as well. This is (slightly) optimized in that local changes only result in additional resources being consumed if (any) local listeners have been created.
This commit is contained in:
@@ -66,9 +66,9 @@ void Flush() {
|
||||
*/
|
||||
|
||||
unsigned int AddEntryListener(StringRef prefix, EntryListenerCallback callback,
|
||||
bool immediate_notify) {
|
||||
bool immediate_notify, bool local_notify) {
|
||||
Notifier& notifier = Notifier::GetInstance();
|
||||
unsigned int uid = notifier.AddEntryListener(prefix, callback);
|
||||
unsigned int uid = notifier.AddEntryListener(prefix, callback, local_notify);
|
||||
notifier.Start();
|
||||
if (immediate_notify) Storage::GetInstance().NotifyEntries(prefix, callback);
|
||||
return uid;
|
||||
|
||||
Reference in New Issue
Block a user