CatapultServer  v0.5.0.1 (Elephant)
HashCacheDelta.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "HashCacheTypes.h"
26 
27 namespace catapult { namespace cache {
28 
31 
34  : public utils::MoveOnly
39  public:
42 
43  public:
45  BasicHashCacheDelta(const HashCacheTypes::BaseSetDeltaPointers& hashSets, const HashCacheTypes::Options& options);
46 
47  public:
50 
53 
54  public:
56  void prune(Timestamp timestamp);
57 
58  private:
62  };
63 
65  class HashCacheDelta : public ReadOnlyViewSupplier<BasicHashCacheDelta> {
66  public:
68  HashCacheDelta(const HashCacheTypes::BaseSetDeltaPointers& hashSets, const HashCacheTypes::Options& options)
69  : ReadOnlyViewSupplier(hashSets, options)
70  {}
71  };
72 }}
catapult::utils::SubtractNonNegative
constexpr Timestamp SubtractNonNegative(const Timestamp &timestamp, const TimeSpan &timeSpan)
Subtracts timeSpan from timestamp and returns the maximum of the difference and zero.
Definition: TimeSpan.h:139
catapult::cache::BasicHashCacheDelta::prune
void prune(Timestamp timestamp)
Removes all timestamped hashes that have timestamps prior to the given timestamp minus the retention ...
Definition: HashCacheDelta.cpp:42
catapult::cache::ReadOnlyViewSupplier
Decorates a view and supplies a read-only view.
Definition: ReadOnlyViewSupplier.h:28
catapult::deltaset::DeltaElementsMixin
Mixin that wraps BaseSetDelta and provides a facade on top of BaseSetDelta::deltas().
Definition: DeltaElementsMixin.h:30
catapult::cache::BasicHashCacheDelta::m_pruningBoundary
deltaset::PruningBoundary< ValueType > m_pruningBoundary
Definition: HashCacheDelta.h:61
ReadOnlyViewSupplier.h
catapult::cache::HashCacheDelta::HashCacheDelta
HashCacheDelta(const HashCacheTypes::BaseSetDeltaPointers &hashSets, const HashCacheTypes::Options &options)
Creates a delta around hashSets and options.
Definition: HashCacheDelta.h:68
catapult::cache::BasicInsertRemoveMixin
A mixin for adding basic insert and remove support to a cache.
Definition: CacheMixins.h:273
catapult::utils::TimeSpan
Represents a time duration.
Definition: TimeSpan.h:30
catapult::utils::BaseValue< uint64_t, Timestamp_tag >
catapult::cache::ReadOnlySimpleCache
A read-only overlay on top of a cache that provides support for contains.
Definition: HashCacheTypes.h:37
catapult::cache::BasicHashCacheDelta::ValueType
HashCacheDescriptor::ValueType ValueType
Definition: HashCacheDelta.h:41
catapult::cache::ContainsMixin
A mixin for adding contains support to a cache.
Definition: CacheMixins.h:54
catapult::cache::detail::OrderedSetAdapter::BaseSetDeltaPointerType
std::shared_ptr< BaseSetDeltaType > BaseSetDeltaPointerType
Base set delta pointer type.
Definition: CacheDescriptorAdapters.h:205
catapult::cache::BasicHashCacheDelta::m_pOrderedDelta
HashCacheTypes::PrimaryTypes::BaseSetDeltaPointerType m_pOrderedDelta
Definition: HashCacheDelta.h:59
catapult::cache::BasicHashCacheDelta::pruningBoundary
deltaset::PruningBoundary< ValueType > pruningBoundary() const
Gets the pruning boundary that is used during commit.
Definition: HashCacheDelta.cpp:38
catapult::state::TimestampedHash
Represents a hash with attached timestamp.
Definition: TimestampedHash.h:31
catapult::cache::BasicHashCacheDelta::m_retentionTime
utils::TimeSpan m_retentionTime
Definition: HashCacheDelta.h:60
catapult::utils::MoveOnly
A class that can be moved but not copied.
Definition: NonCopyable.h:43
CacheMixinAliases.h
catapult::cache::BasicHashCacheDelta::retentionTime
utils::TimeSpan retentionTime() const
Gets the retention time for the cache.
Definition: HashCacheDelta.cpp:34
catapult::cache::HashCacheDelta
Delta on top of the hash cache.
Definition: HashCacheDelta.h:65
catapult::cache::HashCacheTypes::CacheReadOnlyType
ReadOnlySimpleCache< BasicHashCacheView, BasicHashCacheDelta, state::TimestampedHash > CacheReadOnlyType
Definition: HashCacheTypes.h:68
HashCacheDelta.h
ReadOnlySimpleCache.h
catapult::cache::HashCacheDescriptor::ValueType
state::TimestampedHash ValueType
Definition: HashCacheTypes.h:51
catapult::deltaset::PruningBoundary
Represents an optional pruning boundary.
Definition: PruningBoundary.h:27
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::BasicHashCacheDelta
Basic delta on top of the hash cache.
Definition: HashCacheDelta.h:33
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::BasicHashCacheDelta::BasicHashCacheDelta
BasicHashCacheDelta(const HashCacheTypes::BaseSetDeltaPointers &hashSets, const HashCacheTypes::Options &options)
Creates a delta around hashSets and options.
Definition: HashCacheDelta.cpp:25
catapult::cache::BasicCacheMixins
Grouping of all basic cache mixins for a single set.
Definition: CacheMixinAliases.h:30
HashCacheTypes.h