CatapultServer  v0.5.0.1 (Elephant)
HashCache.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "HashCacheDelta.h"
23 #include "HashCacheView.h"
25 
26 namespace catapult { namespace cache {
27 
29 
32  class BasicHashCache : public HashBasicCache {
33  public:
35  explicit BasicHashCache(const CacheConfiguration& config, const utils::TimeSpan& retentionTime)
36  // hash cache should always be excluded from state hash calculation
38  {}
39 
40  private:
42  auto configCopy = config;
43  configCopy.ShouldStorePatriciaTrees = false;
44  return configCopy;
45  }
46  };
47 
49  class HashCache : public SynchronizedCache<BasicHashCache> {
50  public:
52 
53  public:
55  explicit HashCache(const CacheConfiguration& config, const utils::TimeSpan& retentionTime)
56  : SynchronizedCache<BasicHashCache>(BasicHashCache(config, retentionTime))
57  {}
58  };
59 }}
catapult::cache::BasicHashCache
Definition: HashCache.h:32
DEFINE_CACHE_CONSTANTS
#define DEFINE_CACHE_CONSTANTS(NAME)
Defines cache constants for a cache with NAME.
Definition: CacheConstants.h:42
catapult::cache::HashCache
Synchronized cache composed of timestamped hashes of (transaction) elements.
Definition: HashCache.h:49
catapult::tools::Options
boost::program_options::variables_map Options
Provides access to parsed options.
Definition: Options.h:34
catapult::cache::BasicHashCache::DisablePatriciaTreeStorage
static CacheConfiguration DisablePatriciaTreeStorage(const CacheConfiguration &config)
Definition: HashCache.h:41
BasicCache.h
catapult::utils::TimeSpan
Represents a time duration.
Definition: TimeSpan.h:30
HashCacheView.h
catapult::cache::HashCacheTypes
Hash cache types.
Definition: HashCacheTypes.h:67
catapult::cache::SynchronizedCache
Decorator that synchronizes access to a cache.
Definition: SynchronizedCache.h:202
catapult::cache::BasicCache
Definition: BasicCache.h:32
catapult::cache::CacheConfiguration
Cache configuration.
Definition: CacheConfiguration.h:37
HashCacheDelta.h
catapult::cache::HashCache::HashCache
HashCache(const CacheConfiguration &config, const utils::TimeSpan &retentionTime)
Creates a cache around config with the specified retention time (retentionTime).
Definition: HashCache.h:55
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::CacheConfiguration::ShouldStorePatriciaTrees
bool ShouldStorePatriciaTrees
true if patricia trees should be stored, false otherwise.
Definition: CacheConfiguration.h:68
catapult::cache::CacheId::Hash
catapult::cache::BasicHashCache::BasicHashCache
BasicHashCache(const CacheConfiguration &config, const utils::TimeSpan &retentionTime)
Creates a cache around config with the specified retention time (retentionTime).
Definition: HashCache.h:35