CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace catapult {
namespace cache {
39 template<
typename TSet>
84 template<
typename TPrimarySet,
typename TFlatMap>
101 const_iterator(
typename TFlatMap::FindConstIterator&& namespaceIter,
typename TPrimarySet::FindConstIterator&& rootIter)
147 if (!namespaceIter.get())
150 auto historyIter =
m_set.find(namespaceIter.get()->rootId());
151 if (!historyIter.get())
154 return historyIter.get()->isActiveAndUnlocked(height);
160 if (!namespaceIter.get())
163 auto rootIter =
m_set.find(namespaceIter.get()->rootId());
164 return const_iterator(std::move(namespaceIter), std::move(rootIter));
void incrementDeepSize(size_t delta=1)
Increments the deep size by delta.
Definition: NamespaceCacheMixins.h:69
NamespaceId m_id
Definition: NamespaceCacheMixins.h:130
const TFlatMap & m_flatMap
Definition: NamespaceCacheMixins.h:169
size_t Active
Number of unique active namespaces.
Definition: NamespaceCacheMixins.h:32
An iterator that is returned by namespace cache find functions.
Definition: NamespaceCacheMixins.h:88
const_iterator(NamespaceId id)
Creates an uninitialized iterator around id.
Definition: NamespaceCacheMixins.h:95
bool isActive(NamespaceId id, Height height) const
Returns true if the value specified by identifier id is active at height.
Definition: NamespaceCacheMixins.h:145
void incrementActiveSize(size_t delta=1)
Increments the active size by delta.
Definition: NamespaceCacheMixins.h:59
A mixin for calculating the deep size of namespaces.
Definition: NamespaceCacheMixins.h:40
A pair composed of a namespace and its root.
Definition: NamespaceEntry.h:28
A root namespace history.
Definition: RootNamespaceHistory.h:31
Definition: NamespaceCacheMixins.h:85
state::NamespaceEntry m_entry
Definition: NamespaceCacheMixins.h:133
const state::NamespaceEntry & get() const
Definition: NamespaceCacheMixins.h:111
TFlatMap::FindConstIterator m_namespaceIter
Definition: NamespaceCacheMixins.h:131
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
const_iterator()
Creates an uninitialized iterator.
Definition: NamespaceCacheMixins.h:91
const state::NamespaceEntry * tryGet() const
Tries to get a const value.
Definition: NamespaceCacheMixins.h:119
NamespaceLookupMixin(const TPrimarySet &set, const TFlatMap &flatMap)
Creates a mixin around (history by id) set and flatMap.
Definition: NamespaceCacheMixins.h:138
size_t deepSize() const
Gets the total number of namespaces in the cache (including versions).
Definition: NamespaceCacheMixins.h:53
const_iterator find(NamespaceId id) const
Finds the cache value identified by id.
Definition: NamespaceCacheMixins.h:158
NamespaceDeepSizeMixin(const NamespaceSizes &sizes)
Creates a mixin around sizes.
Definition: NamespaceCacheMixins.h:43
size_t activeSize() const
Gets the number of unique active namespaces in the cache.
Definition: NamespaceCacheMixins.h:48
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
bool m_isValid
Definition: NamespaceCacheMixins.h:129
NamespaceSizes m_sizes
Definition: NamespaceCacheMixins.h:79
void decrementDeepSize(size_t delta=1)
Decrements the deep size by delta.
Definition: NamespaceCacheMixins.h:74
const state::RootNamespaceHistory * tryGetUnadapted() const
Tries to get a const (unadapted) value.
Definition: NamespaceCacheMixins.h:124
size_t Deep
Total number of namespaces (including all versions).
Definition: NamespaceCacheMixins.h:35
const_iterator(typename TFlatMap::FindConstIterator &&namespaceIter, typename TPrimarySet::FindConstIterator &&rootIter)
Creates an iterator around a namespace iterator (namespaceIter) and a root iterator (rootIter).
Definition: NamespaceCacheMixins.h:101
void decrementActiveSize(size_t delta=1)
Decrements the active size by delta.
Definition: NamespaceCacheMixins.h:64
Definition: AddressExtractionExtension.cpp:28
Extended namespace sizes.
Definition: NamespaceCacheMixins.h:30
const TPrimarySet & m_set
Definition: NamespaceCacheMixins.h:168
TPrimarySet::FindConstIterator m_rootIter
Definition: NamespaceCacheMixins.h:132