26 namespace catapult {
namespace cache {
43 template<
typename T,
typename =
void>
61 return value.isActive(height);
70 template<
typename TTree,
typename TSet>
72 auto needsApplication = [&set, minGenerationId, maxGenerationId = set.generationId()](
const auto& key) {
73 auto generationId = set.generationId(key);
74 return minGenerationId <= generationId && generationId <= maxGenerationId;
77 auto handleModification = [&tree, height](
const auto& pair) {
79 tree.set(pair.first, pair.second);
81 tree.unset(pair.first);
84 auto deltas = set.deltas();
85 for (
const auto& pair : deltas.Added) {
86 if (needsApplication(pair.first)) {
88 handleModification(pair);
92 for (
const auto& pair : deltas.Copied) {
93 if (needsApplication(pair.first))
94 handleModification(pair);
97 for (
const auto& pair : deltas.Removed) {
98 if (needsApplication(pair.first))
99 tree.unset(pair.first);