CatapultServer  v0.5.0.1 (Elephant)
catapult::cache::BasicNamespaceCacheDelta Class Reference

Basic delta on top of the namespace cache. More...

Inheritance diagram for catapult::cache::BasicNamespaceCacheDelta:
Collaboration diagram for catapult::cache::BasicNamespaceCacheDelta:

Public Types

using ReadOnlyView = NamespaceCacheTypes::CacheReadOnlyType
 
using CollectedIds = std::unordered_set< NamespaceId, utils::BaseValueHasher< NamespaceId > >
 

Public Member Functions

 BasicNamespaceCacheDelta (const NamespaceCacheTypes::BaseSetDeltaPointers &namespaceSets, const NamespaceCacheTypes::Options &options, const NamespaceSizes &namespaceSizes)
 Creates a delta around namespaceSets, options and namespaceSizes. More...
 
void insert (const state::RootNamespace &ns)
 Inserts the root namespace ns into the cache. More...
 
void insert (const state::Namespace &ns)
 Inserts the namespace ns into the cache. More...
 
void setAlias (NamespaceId id, const state::NamespaceAlias &alias)
 Sets an alias for namespace id. More...
 
void remove (NamespaceId id)
 Removes the namespace specified by its id from the cache. More...
 
CollectedIds prune (Height height)
 Prunes the namespace cache at height. More...
 
- Public Member Functions inherited from catapult::utils::MoveOnly
constexpr MoveOnly ()=default
 Default constructor. More...
 
 ~MoveOnly ()=default
 Default destructor. More...
 
 MoveOnly (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
 MoveOnly (MoveOnly &&)=default
 Default move constructor. More...
 
MoveOnlyoperator= (const MoveOnly &)=delete
 Disabled assignment operator. More...
 
MoveOnlyoperator= (MoveOnly &&)=default
 Default move assignment operator. More...
 
- Public Member Functions inherited from catapult::cache::ContainsMixin< TSet, TCacheDescriptor >
 ContainsMixin (const TSet &set)
 Creates a mixin around set. More...
 
bool contains (const KeyType &key) const
 Gets a value indicating whether or not the cache contains an element with key. More...
 
- Public Member Functions inherited from catapult::cache::PatriciaTreeDeltaMixin< TSet, TTree >
 PatriciaTreeDeltaMixin (TSet &set, const std::shared_ptr< TTree > &pTree)
 Creates a mixin around delta set and pTree. More...
 
bool supportsMerkleRoot () const
 Returns true if merkle root is supported. More...
 
std::pair< Hash256, bool > tryGetMerkleRoot () const
 Tries to get the merkle root if supported. More...
 
void updateMerkleRoot (Height height)
 Recalculates the merkle root given the specified chain height if supported. More...
 
void setMerkleRoot (const Hash256 &merkleRoot)
 
- Public Member Functions inherited from catapult::cache::HeightBasedTouchMixin< TSet, THeightGroupedSet >
 HeightBasedTouchMixin (TSet &set, THeightGroupedSet &heightGroupedSet)
 Creates a mixin around set and heightGroupedSet. More...
 
THeightGroupedSet::ElementType::Identifiers touch (Height height)
 Touches the cache at height and returns identifiers of all deactivating elements. More...
 
- Public Member Functions inherited from catapult::cache::NamespaceDeepSizeMixin< TSet >
 NamespaceDeepSizeMixin (const NamespaceSizes &sizes)
 Creates a mixin around sizes. More...
 
size_t activeSize () const
 Gets the number of unique active namespaces in the cache. More...
 
size_t deepSize () const
 Gets the total number of namespaces in the cache (including versions). More...
 
- Public Member Functions inherited from catapult::cache::NamespaceLookupMixin< TPrimarySet, TFlatMap >
 NamespaceLookupMixin (const TPrimarySet &set, const TFlatMap &flatMap)
 Creates a mixin around (history by id) set and flatMap. More...
 
bool isActive (NamespaceId id, Height height) const
 Returns true if the value specified by identifier id is active at height. More...
 
const_iterator find (NamespaceId id) const
 Finds the cache value identified by id. More...
 

Private Member Functions

void removeRoot (NamespaceId id)
 
void removeChild (const state::Namespace &ns)
 

Private Attributes

NamespaceCacheTypes::PrimaryTypes::BaseSetDeltaPointerType m_pHistoryById
 
NamespaceCacheTypes::NamespaceCacheTypes::FlatMapTypes::BaseSetDeltaPointerType m_pNamespaceById
 
NamespaceCacheTypes::HeightGroupingTypes::BaseSetDeltaPointerType m_pRootNamespaceIdsByExpiryHeight
 
BlockDuration m_gracePeriodDuration
 

Additional Inherited Members

- Protected Member Functions inherited from catapult::cache::NamespaceDeepSizeMixin< TSet >
void incrementActiveSize (size_t delta=1)
 Increments the active size by delta. More...
 
void decrementActiveSize (size_t delta=1)
 Decrements the active size by delta. More...
 
void incrementDeepSize (size_t delta=1)
 Increments the deep size by delta. More...
 
void decrementDeepSize (size_t delta=1)
 Decrements the deep size by delta. More...
 

Detailed Description

Basic delta on top of the namespace cache.

Member Typedef Documentation

◆ CollectedIds

◆ ReadOnlyView

Constructor & Destructor Documentation

◆ BasicNamespaceCacheDelta()

catapult::cache::BasicNamespaceCacheDelta::BasicNamespaceCacheDelta ( const NamespaceCacheTypes::BaseSetDeltaPointers namespaceSets,
const NamespaceCacheTypes::Options options,
const NamespaceSizes namespaceSizes 
)

Creates a delta around namespaceSets, options and namespaceSizes.

Member Function Documentation

◆ insert() [1/2]

void catapult::cache::BasicNamespaceCacheDelta::insert ( const state::Namespace ns)

Inserts the namespace ns into the cache.

Here is the call graph for this function:

◆ insert() [2/2]

void catapult::cache::BasicNamespaceCacheDelta::insert ( const state::RootNamespace ns)

Inserts the root namespace ns into the cache.

Here is the call graph for this function:

◆ prune()

BasicNamespaceCacheDelta::CollectedIds catapult::cache::BasicNamespaceCacheDelta::prune ( Height  height)

Prunes the namespace cache at height.

Here is the call graph for this function:

◆ remove()

void catapult::cache::BasicNamespaceCacheDelta::remove ( NamespaceId  id)

Removes the namespace specified by its id from the cache.

Here is the call graph for this function:

◆ removeChild()

void catapult::cache::BasicNamespaceCacheDelta::removeChild ( const state::Namespace ns)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeRoot()

void catapult::cache::BasicNamespaceCacheDelta::removeRoot ( NamespaceId  id)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAlias()

void catapult::cache::BasicNamespaceCacheDelta::setAlias ( NamespaceId  id,
const state::NamespaceAlias alias 
)

Sets an alias for namespace id.

Member Data Documentation

◆ m_gracePeriodDuration

BlockDuration catapult::cache::BasicNamespaceCacheDelta::m_gracePeriodDuration
private

◆ m_pHistoryById

NamespaceCacheTypes::PrimaryTypes::BaseSetDeltaPointerType catapult::cache::BasicNamespaceCacheDelta::m_pHistoryById
private

◆ m_pNamespaceById

NamespaceCacheTypes::NamespaceCacheTypes::FlatMapTypes::BaseSetDeltaPointerType catapult::cache::BasicNamespaceCacheDelta::m_pNamespaceById
private

◆ m_pRootNamespaceIdsByExpiryHeight

NamespaceCacheTypes::HeightGroupingTypes::BaseSetDeltaPointerType catapult::cache::BasicNamespaceCacheDelta::m_pRootNamespaceIdsByExpiryHeight
private

The documentation for this class was generated from the following files: