25 namespace catapult {
namespace cache {
28 template<
typename TCache,
typename TStorageTraits>
37 WriteCacheChanges<TStorageTraits>(changes.
sub<TCache>(), output);
41 auto pMemoryCacheChanges = std::make_unique<MemoryCacheChangesT<typename TCache::CacheValueType>>();
42 ReadCacheChanges<TStorageTraits>(input, *pMemoryCacheChanges);
43 return std::move(pMemoryCacheChanges);
47 auto delta =
m_cache.createDelta();
49 auto subCacheChanges = changes.
sub<TCache>();
50 for (
const auto* pAdded : subCacheChanges.addedElements()) {
51 TStorageTraits::Purge(*pAdded, *delta);
52 TStorageTraits::LoadInto(*pAdded, *delta);
55 for (
const auto* pModified : subCacheChanges.modifiedElements()) {
56 TStorageTraits::Purge(*pModified, *delta);
57 TStorageTraits::LoadInto(*pModified, *delta);
60 for (
const auto* pRemoved : subCacheChanges.removedElements())
61 TStorageTraits::Purge(*pRemoved, *delta);