mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Support immediate notify of connection listener.
Also only perform immediate notification to the callback actually requesting the notification, not all existing callbacks. Offset returned uids by 1 so uid=0 can be used to indicate immediate notification.
This commit is contained in:
@@ -606,11 +606,12 @@ std::vector<EntryInfo> Storage::GetEntryInfo(StringRef prefix,
|
||||
return infos;
|
||||
}
|
||||
|
||||
void Storage::NotifyEntries(StringRef prefix) {
|
||||
void Storage::NotifyEntries(StringRef prefix,
|
||||
EntryListenerCallback only) const {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
for (auto& i : m_entries) {
|
||||
if (!i.getKey().startswith(prefix)) continue;
|
||||
m_notifier.NotifyEntry(i.getKey(), i.getValue()->value, false);
|
||||
m_notifier.NotifyEntry(i.getKey(), i.getValue()->value, false, only);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user