CatapultServer  v0.5.0.1 (Elephant)
AccountStateCacheView.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "AccountStateBaseSets.h"
28 
29 namespace catapult { namespace cache {
30 
33  public:
35 
36  private:
39 
40  public:
43  using ContainsKey = ContainsMixin<
50  };
51 
54  : public utils::MoveOnly
62  public:
64 
65  public:
68  const AccountStateCacheTypes::BaseSets& accountStateSets,
69  const AccountStateCacheTypes::Options& options,
71 
72  private:
74  const AccountStateCacheTypes::BaseSets& accountStateSets,
75  const AccountStateCacheTypes::Options& options,
77  std::unique_ptr<AccountStateCacheViewMixins::KeyLookupAdapter>&& pKeyLookupAdapter);
78 
79  public:
82 
85 
86  public:
89 
91  uint64_t importanceGrouping() const;
92 
95 
98 
99  public:
101  const model::AddressSet& highValueAddresses() const;
102 
103  private:
106  std::unique_ptr<AccountStateCacheViewMixins::KeyLookupAdapter> m_pKeyLookupAdapter;
107  };
108 
110  class AccountStateCacheView : public ReadOnlyViewSupplier<BasicAccountStateCacheView> {
111  public:
114  const AccountStateCacheTypes::BaseSets& accountStateSets,
115  const AccountStateCacheTypes::Options& options,
117  : ReadOnlyViewSupplier(accountStateSets, options, highValueAddresses)
118  {}
119  };
120 }}
ReadOnlyAccountStateCache.h
catapult::cache::BasicCacheMixins::Size
SizeMixin< TSet > Size
Definition: CacheMixinAliases.h:31
catapult::cache::IterationMixin
A mixin for adding iteration support to a cache.
Definition: CacheMixins.h:75
catapult::cache::BasicAccountStateCacheView::BasicAccountStateCacheView
BasicAccountStateCacheView(const AccountStateCacheTypes::BaseSets &accountStateSets, const AccountStateCacheTypes::Options &options, const model::AddressSet &highValueAddresses)
Creates a view around accountStateSets, options and highValueAddresses.
Definition: AccountStateCacheView.cpp:27
catapult::cache::PatriciaTreeCacheMixins::PatriciaTreeView
PatriciaTreeMixin< typename TCacheDescriptor::PatriciaTree > PatriciaTreeView
Definition: CacheMixinAliases.h:53
catapult::cache::AccountStateCacheTypes::Options::ImportanceGrouping
uint64_t ImportanceGrouping
Importance grouping.
Definition: AccountStateCacheTypes.h:84
catapult::cache::ReadOnlyViewSupplier
Decorates a view and supplies a read-only view.
Definition: ReadOnlyViewSupplier.h:28
catapult::cache::PatriciaTreeMixin
A mixin for adding patricia tree support to a cache.
Definition: PatriciaTreeCacheMixins.h:30
catapult::model::AddressSet
std::unordered_set< Address, utils::ArrayHasher< Address > > AddressSet
Unordered set of addresses.
Definition: ContainerTypes.h:41
ReadOnlyViewSupplier.h
catapult::cache::AccountStateCacheTypes::Options::HarvestingMosaicId
MosaicId HarvestingMosaicId
Mosaic id used to provide harvesting ability.
Definition: AccountStateCacheTypes.h:94
catapult::cache::BasicAccountStateCacheView::minHarvesterBalance
Amount minHarvesterBalance() const
Gets the minimum harvester balance.
Definition: AccountStateCacheView.cpp:65
catapult::utils::BaseValue< uint64_t, Amount_tag >
catapult::cache::PatriciaTreeCacheMixins
Grouping of all basic and patricia tree cache mixins for a single set.
Definition: CacheMixinAliases.h:52
catapult::cache::ConstAccessorMixin
A mixin for adding const access support to a cache.
Definition: CacheMixins.h:190
catapult::cache::AccountStateCacheTypes::Options
Custom sub view options.
Definition: AccountStateCacheTypes.h:79
AccountStateCacheView.h
catapult::cache::AccountStateCacheViewMixins
Mixins used by the account state cache view.
Definition: AccountStateCacheView.h:32
NetworkInfo.h
catapult::cache::BasicCacheMixins::Contains
ContainsMixin< TSet, TCacheDescriptor > Contains
Definition: CacheMixinAliases.h:32
catapult::cache::BasicAccountStateCacheView::harvestingMosaicId
MosaicId harvestingMosaicId() const
Gets the harvesting mosaic id.
Definition: AccountStateCacheView.cpp:69
catapult::cache::BasicCacheMixins::Iteration
IterationMixin< TSet > Iteration
Definition: CacheMixinAliases.h:33
catapult::cache::BasicAccountStateCacheView::m_options
const AccountStateCacheTypes::Options & m_options
Definition: AccountStateCacheView.h:104
catapult::cache::BasicCacheMixins::ConstAccessor
ConstAccessorMixin< TSet, TCacheDescriptor > ConstAccessor
Definition: CacheMixinAliases.h:35
AccountStateBaseSets.h
catapult::cache::BasicAccountStateCacheView::networkIdentifier
model::NetworkIdentifier networkIdentifier() const
Gets the network identifier.
Definition: AccountStateCacheView.cpp:57
catapult::cache::AccountStateCacheViewMixins::Size
AddressMixins::Size Size
Definition: AccountStateCacheView.h:41
catapult::cache::ContainsMixin
A mixin for adding contains support to a cache.
Definition: CacheMixins.h:54
catapult::cache::ConstAccessorMixin::find
const_iterator find(const KeyType &key) const
Finds the cache value identified by key.
Definition: CacheMixins.h:207
Address.h
catapult::cache::detail::UnorderedMapAdapter::BaseSetType
deltaset::BaseSet< TElementTraits, StorageTraits > BaseSetType
Base set type.
Definition: CacheDescriptorAdapters.h:81
catapult::utils::MoveOnly
A class that can be moved but not copied.
Definition: NonCopyable.h:43
CacheMixinAliases.h
catapult::model::NetworkIdentifier
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
catapult::cache::AccountStateCacheViewMixins::Iteration
AddressMixins::Iteration Iteration
Definition: AccountStateCacheView.h:46
ContainerTypes.h
catapult::cache::AccountStateCacheTypes::KeyLookupMapTypesDescriptor
Describes a key-based interface on top of an account state cache.
Definition: AccountStateCacheTypes.h:101
catapult::cache::AccountStateCacheTypes::ComposedLookupAdapter
Definition: AccountStateCacheTypes.h:121
catapult::cache::AccountStateBaseSets
Definition: AccountStateBaseSets.h:47
m_options
CompareChainsOptions m_options
Definition: CompareChains.cpp:165
catapult::cache::ContainsMixin::contains
bool contains(const KeyType &key) const
Gets a value indicating whether or not the cache contains an element with key.
Definition: CacheMixins.h:65
catapult::cache::BasicAccountStateCacheView::m_highValueAddresses
const model::AddressSet & m_highValueAddresses
Definition: AccountStateCacheView.h:105
catapult::cache::AccountStateCacheTypes::Options::MinHarvesterBalance
Amount MinHarvesterBalance
Definition: AccountStateCacheTypes.h:88
AccountStateCacheSerializers.h
catapult::cache::AccountStateCacheTypes::Options::NetworkIdentifier
model::NetworkIdentifier NetworkIdentifier
Network identifier.
Definition: AccountStateCacheTypes.h:81
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::cache::BasicAccountStateCacheView
Basic view on top of the account state cache.
Definition: AccountStateCacheView.h:53
catapult::cache::SizeMixin
A mixin for adding size support to a cache.
Definition: CacheMixins.h:36
catapult::cache::AccountStateCacheViewMixins::ContainsAddress
AddressMixins::Contains ContainsAddress
Definition: AccountStateCacheView.h:42
catapult::cache::BasicAccountStateCacheView::m_pKeyLookupAdapter
std::unique_ptr< AccountStateCacheViewMixins::KeyLookupAdapter > m_pKeyLookupAdapter
Definition: AccountStateCacheView.h:106
catapult::cache::ReadOnlyAccountStateCache
A read-only overlay on top of an account cache.
Definition: ReadOnlyAccountStateCache.h:36
catapult::cache::AccountStateCacheView
View on top of the account state cache.
Definition: AccountStateCacheView.h:110
catapult::cache::AccountStateCacheView::AccountStateCacheView
AccountStateCacheView(const AccountStateCacheTypes::BaseSets &accountStateSets, const AccountStateCacheTypes::Options &options, const model::AddressSet &highValueAddresses)
Creates a view around accountStateSets, options and highValueAddresses.
Definition: AccountStateCacheView.h:113
catapult::cache::BasicAccountStateCacheView::importanceGrouping
uint64_t importanceGrouping() const
Gets the network importance grouping.
Definition: AccountStateCacheView.cpp:61
catapult::cache::AccountStateCacheViewMixins::ConstAccessorAddress
AddressMixins::ConstAccessor ConstAccessorAddress
Definition: AccountStateCacheView.h:47
catapult::cache::BasicCacheMixins
Grouping of all basic cache mixins for a single set.
Definition: CacheMixinAliases.h:30
catapult::cache::BasicAccountStateCacheView::highValueAddresses
const model::AddressSet & highValueAddresses() const
Gets all high value addresses.
Definition: AccountStateCacheView.cpp:73