CatapultServer  v0.5.0.1 (Elephant)
HashCacheView.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "HashCacheSerializers.h"
23 #include "HashCacheTypes.h"
27 
28 namespace catapult { namespace cache {
29 
32 
35  : public utils::MoveOnly
39  public:
41 
42  public:
44  explicit BasicHashCacheView(const HashCacheTypes::BaseSets& hashSets, const HashCacheTypes::Options& options)
45  : HashCacheViewMixins::Size(hashSets.Primary)
46  , HashCacheViewMixins::Contains(hashSets.Primary)
47  , HashCacheViewMixins::Iteration(hashSets.Primary)
48  , m_retentionTime(options.RetentionTime)
49  {}
50 
51  public:
54  return m_retentionTime;
55  }
56 
57  private:
59  };
60 
62  class HashCacheView : public ReadOnlyViewSupplier<BasicHashCacheView> {
63  public:
65  explicit HashCacheView(const HashCacheTypes::BaseSets& hashSets, const HashCacheTypes::Options& options)
66  : ReadOnlyViewSupplier(hashSets, options)
67  {}
68  };
69 }}
catapult::cache::IterationMixin
A mixin for adding iteration support to a cache.
Definition: CacheMixins.h:75
catapult::cache::HashCacheView::HashCacheView
HashCacheView(const HashCacheTypes::BaseSets &hashSets, const HashCacheTypes::Options &options)
Creates a view around hashSets and options.
Definition: HashCacheView.h:65
catapult::cache::ReadOnlyViewSupplier
Decorates a view and supplies a read-only view.
Definition: ReadOnlyViewSupplier.h:28
catapult::cache::BasicHashCacheView::BasicHashCacheView
BasicHashCacheView(const HashCacheTypes::BaseSets &hashSets, const HashCacheTypes::Options &options)
Creates a view around hashSets and options.
Definition: HashCacheView.h:44
ReadOnlyViewSupplier.h
catapult::utils::TimeSpan
Represents a time duration.
Definition: TimeSpan.h:30
catapult::cache::HashCacheView
View on top of the hash cache.
Definition: HashCacheView.h:62
catapult::cache::ReadOnlySimpleCache
A read-only overlay on top of a cache that provides support for contains.
Definition: HashCacheTypes.h:37
catapult::cache::ContainsMixin
A mixin for adding contains support to a cache.
Definition: CacheMixins.h:54
HashCacheSerializers.h
catapult::utils::MoveOnly
A class that can be moved but not copied.
Definition: NonCopyable.h:43
CacheMixinAliases.h
catapult::cache::BasicHashCacheView::m_retentionTime
utils::TimeSpan m_retentionTime
Definition: HashCacheView.h:58
catapult::cache::HashCacheTypes::CacheReadOnlyType
ReadOnlySimpleCache< BasicHashCacheView, BasicHashCacheDelta, state::TimestampedHash > CacheReadOnlyType
Definition: HashCacheTypes.h:68
catapult::cache::BasicHashCacheView
Basic view on top of the hash cache.
Definition: HashCacheView.h:34
ReadOnlySimpleCache.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::SizeMixin
A mixin for adding size support to a cache.
Definition: CacheMixins.h:36
catapult::cache::HashCacheTypes::Options
Custom sub view options.
Definition: HashCacheTypes.h:71
catapult::cache::BasicHashCacheView::retentionTime
utils::TimeSpan retentionTime() const
Gets the retention time for the cache.
Definition: HashCacheView.h:53
catapult::cache::BasicCacheMixins
Grouping of all basic cache mixins for a single set.
Definition: CacheMixinAliases.h:30
HashCacheTypes.h