CatapultServer  v0.5.0.1 (Elephant)
BlockDifficultyCacheTypes.h
Go to the documentation of this file.
1 
21 #pragma once
25 
26 namespace catapult {
27  namespace cache {
28  class BasicBlockDifficultyCacheDelta;
29  class BasicBlockDifficultyCacheView;
30  class BlockDifficultyCache;
31  class BlockDifficultyCacheDelta;
32  class BlockDifficultyCacheView;
33 
34  template<typename TCache, typename TCacheDelta, typename TKey>
35  class ReadOnlySimpleCache;
36  }
37 }
38 
39 namespace catapult { namespace cache {
40 
43  public:
44  // key value types
46  using ValueType = KeyType;
47 
48  // cache types
52 
53  public:
55  static const auto& GetKeyFromValue(const ValueType& blockDifficultyInfo) {
56  return blockDifficultyInfo;
57  }
58  };
59 
63  : public SingleSetCacheTypesAdapter<MutableOrderedMemorySetAdapter<BlockDifficultyCacheDescriptor>, std::true_type> {
68 
70  struct Options {
73  };
74  };
75 
78  private:
79  using IteratorType = BlockDifficultyCacheTypes::PrimaryTypes::BaseSetType::SetType::MemorySetType::const_iterator;
80 
81  public:
84  : m_begin(begin)
85  , m_end(end)
86  {}
87 
88  public:
90  IteratorType begin() const {
91  return m_begin;
92  }
93 
95  IteratorType end() const {
96  return m_end;
97  }
98 
99  private:
102  };
103 }}
catapult::cache::DifficultyInfoRange::m_end
const IteratorType m_end
Definition: BlockDifficultyCacheTypes.h:101
BlockDifficultyInfo.h
catapult::cache::DifficultyInfoRange::DifficultyInfoRange
DifficultyInfoRange(const IteratorType &begin, const IteratorType &end)
Creates a range around two iterators begin and end.
Definition: BlockDifficultyCacheTypes.h:83
catapult::cache::DifficultyInfoRange::m_begin
const IteratorType m_begin
Definition: BlockDifficultyCacheTypes.h:100
catapult::cache::BlockDifficultyCacheDescriptor
Describes a block difficulty cache.
Definition: BlockDifficultyCacheTypes.h:42
catapult::cache::DifficultyInfoRange::begin
IteratorType begin() const
Returns an iterator that represents the first element.
Definition: BlockDifficultyCacheTypes.h:90
catapult::state::BlockDifficultyInfo
Definition: BlockDifficultyInfo.h:28
catapult::cache::DifficultyInfoRange
A range of block difficulty infos.
Definition: BlockDifficultyCacheTypes.h:77
catapult::cache::ReadOnlySimpleCache
A read-only overlay on top of a cache that provides support for contains.
Definition: HashCacheTypes.h:37
SingleSetCacheTypesAdapter.h
catapult::cache::BasicBlockDifficultyCacheView
Basic view on top of the block difficulty cache.
Definition: BlockDifficultyCacheView.h:35
catapult::cache::BlockDifficultyCacheTypes::Options
Custom sub view options.
Definition: BlockDifficultyCacheTypes.h:70
catapult::cache::BlockDifficultyCacheTypes::Options::DifficultyHistorySize
uint64_t DifficultyHistorySize
Difficulty history size.
Definition: BlockDifficultyCacheTypes.h:72
catapult::cache::BlockDifficultyCacheView
View on top of the block difficulty cache.
Definition: BlockDifficultyCacheView.h:58
catapult::cache::BasicBlockDifficultyCacheDelta
Basic delta on top of the block difficulty cache.
Definition: BlockDifficultyCacheDelta.h:36
catapult::cache::BlockDifficultyCacheDescriptor::KeyType
state::BlockDifficultyInfo KeyType
Definition: BlockDifficultyCacheTypes.h:45
CacheDescriptorAdapters.h
catapult::cache::BlockDifficultyCacheDelta
Delta on top of the block difficulty cache.
Definition: BlockDifficultyCacheDelta.h:93
catapult::cache::DifficultyInfoRange::IteratorType
BlockDifficultyCacheTypes::PrimaryTypes::BaseSetType::SetType::MemorySetType::const_iterator IteratorType
Definition: BlockDifficultyCacheTypes.h:79
catapult::cache::BlockDifficultyCacheTypes
Definition: BlockDifficultyCacheTypes.h:62
catapult::cache::BlockDifficultyCacheDescriptor::GetKeyFromValue
static const auto & GetKeyFromValue(const ValueType &blockDifficultyInfo)
Gets the key corresponding to blockDifficultyInfo.
Definition: BlockDifficultyCacheTypes.h:55
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::DifficultyInfoRange::end
IteratorType end() const
Returns an iterator that represents one past the last element.
Definition: BlockDifficultyCacheTypes.h:95
catapult::cache::BlockDifficultyCache
Synchronized cache composed of block difficulty information.
Definition: BlockDifficultyCache.h:45
catapult::cache::SingleSetCacheTypesAdapter
A cache types adapter for a cache composed of a single set.
Definition: SingleSetCacheTypesAdapter.h:31