CatapultServer  v0.5.0.1 (Elephant)
BlockDifficultyCacheView.h
Go to the documentation of this file.
1 
21 #pragma once
26 
27 namespace catapult { namespace cache {
28 
30  using BlockDifficultyCacheViewMixins = BasicCacheMixins<
33 
36  : public utils::MoveOnly
40  public:
42 
43  public:
46  const BlockDifficultyCacheTypes::BaseSets& difficultyInfoSets,
47  const BlockDifficultyCacheTypes::Options& options);
48 
49  public:
51  DifficultyInfoRange difficultyInfos(Height height, size_t count) const;
52 
53  private:
55  };
56 
58  class BlockDifficultyCacheView : public ReadOnlyViewSupplier<BasicBlockDifficultyCacheView> {
59  public:
62  const BlockDifficultyCacheTypes::BaseSets& difficultyInfoSets,
64  : ReadOnlyViewSupplier(difficultyInfoSets, options)
65  {}
66  };
67 }}
catapult::cache::IterationMixin
A mixin for adding iteration support to a cache.
Definition: CacheMixins.h:75
exceptions.h
catapult::cache::ReadOnlyViewSupplier
Decorates a view and supplies a read-only view.
Definition: ReadOnlyViewSupplier.h:28
catapult::cache::BlockDifficultyCacheTypes::CacheReadOnlyType
ReadOnlySimpleCache< BasicBlockDifficultyCacheView, BasicBlockDifficultyCacheDelta, state::BlockDifficultyInfo > CacheReadOnlyType
Definition: BlockDifficultyCacheTypes.h:67
catapult::Height
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
catapult::cache::BlockDifficultyCacheDescriptor
Describes a block difficulty cache.
Definition: BlockDifficultyCacheTypes.h:42
ReadOnlyViewSupplier.h
BaseSetIterationView.h
catapult::state::BlockDifficultyInfo
Definition: BlockDifficultyInfo.h:28
catapult::utils::BasicBaseValue::unwrap
constexpr ValueType unwrap() const
Unwraps this value and returns the underlying raw value.
Definition: BaseValue.h:53
catapult::cache::DifficultyInfoRange
A range of block difficulty infos.
Definition: BlockDifficultyCacheTypes.h:77
catapult::utils::BaseValue< uint64_t, Height_tag >
catapult::cache::BasicBlockDifficultyCacheView::BasicBlockDifficultyCacheView
BasicBlockDifficultyCacheView(const BlockDifficultyCacheTypes::BaseSets &difficultyInfoSets, const BlockDifficultyCacheTypes::Options &options)
Creates a view around difficultyInfoSets and options.
Definition: BlockDifficultyCacheView.cpp:27
BlockDifficultyCacheTypes.h
catapult::cache::ReadOnlySimpleCache
A read-only overlay on top of a cache that provides support for contains.
Definition: HashCacheTypes.h:37
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::ContainsMixin
A mixin for adding contains support to a cache.
Definition: CacheMixins.h:54
catapult::cache::BlockDifficultyCacheView
View on top of the block difficulty cache.
Definition: BlockDifficultyCacheView.h:58
CATAPULT_THROW_INVALID_ARGUMENT_1
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
catapult::cache::detail::OrderedMemorySetAdapter::BaseSetType
deltaset::OrderedSet< TElementTraits, StorageTraits > BaseSetType
Base set type.
Definition: CacheDescriptorAdapters.h:134
catapult::cache::BlockDifficultyCacheView::BlockDifficultyCacheView
BlockDifficultyCacheView(const BlockDifficultyCacheTypes::BaseSets &difficultyInfoSets, const BlockDifficultyCacheTypes::Options &options)
Creates a view around difficultyInfoSets and options.
Definition: BlockDifficultyCacheView.h:61
catapult::cache::BasicBlockDifficultyCacheView::difficultyInfos
DifficultyInfoRange difficultyInfos(Height height, size_t count) const
Gets a range object that spans count block difficulty infos starting at the specified height.
Definition: BlockDifficultyCacheView.cpp:42
BlockDifficultyCacheView.h
catapult::utils::MoveOnly
A class that can be moved but not copied.
Definition: NonCopyable.h:43
CacheMixinAliases.h
CATAPULT_THROW_RUNTIME_ERROR
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
ReadOnlySimpleCache.h
catapult::cache::BasicBlockDifficultyCacheView::m_difficultyInfos
const BlockDifficultyCacheTypes::PrimaryTypes::BaseSetType & m_difficultyInfos
Definition: BlockDifficultyCacheView.h:54
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::SizeMixin
A mixin for adding size support to a cache.
Definition: CacheMixins.h:36
catapult::deltaset::MakeIterableView
BaseSetDeltaIterationView< TSetTraits > MakeIterableView(const BaseSetDelta< TElementTraits, TSetTraits > &delta)
Definition: BaseSetDeltaIterationView.h:200
catapult::cache::BlockDifficultyCacheViewMixins
BasicCacheMixins< BlockDifficultyCacheTypes::PrimaryTypes::BaseSetType, BlockDifficultyCacheDescriptor > BlockDifficultyCacheViewMixins
Mixins used by the block difficulty cache view.
Definition: BlockDifficultyCacheView.h:32
catapult::cache::BasicCacheMixins
Grouping of all basic cache mixins for a single set.
Definition: CacheMixinAliases.h:30