ensure invalidated values are removed

When a node receives an InvalidateCache signal, it will
automatically signal its outputs to discard any cached values in
the invalidated time range
This commit is contained in:
itsmattkc
2019-11-17 12:31:10 +09:00
parent 863525c595
commit 35802d37b0
3 changed files with 21 additions and 0 deletions
+13
View File
@@ -58,3 +58,16 @@ void NodeOutput::drop_cached_values()
{
cached_values_.clear();
}
void NodeOutput::drop_cached_values_overlapping(const TimeRange &time)
{
QHash<TimeRange, QVariant>::iterator i = cached_values_.begin();
while (i != cached_values_.end()) {
if (i.key().OverlapsWith(time)) {
i = cached_values_.erase(i);
} else {
i++;
}
}
}