CatapultServer  v0.5.0.1 (Elephant)
NamespaceCacheTypes.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "src/state/Namespace.h"
28 #include "catapult/utils/Hashers.h"
30 
31 namespace catapult {
32  namespace cache {
33  class BasicNamespaceCacheDelta;
34  class BasicNamespaceCacheView;
35  struct NamespaceBaseSetDeltaPointers;
36  struct NamespaceBaseSets;
37  class NamespaceCache;
38  class NamespaceCacheDelta;
39  class NamespaceCacheView;
40  struct NamespaceFlatMapTypesSerializer;
41  struct NamespaceHeightGroupingSerializer;
42  class NamespacePatriciaTree;
43 
44  template<typename TCache, typename TCacheDelta, typename TKey, typename TGetResult>
45  class ReadOnlyArtifactCache;
46  struct RootNamespaceHistoryPrimarySerializer;
47  }
48 }
49 
50 namespace catapult { namespace cache {
51 
54  public:
55  static constexpr auto Name = "NamespaceCache";
56 
57  public:
58  // key value types
61 
62  // cache types
66 
69 
70  public:
72  static auto GetKeyFromValue(const ValueType& history) {
73  return history.id();
74  }
75  };
76 
79  public:
85 
87  struct Options {
90  };
91 
92  // region secondary descriptors
93 
94  private:
96  public:
100 
101  public:
102  static auto GetKeyFromValue(const ValueType& ns) {
103  return ns.id();
104  }
105  };
106 
107  public:
109  public:
110  using KeyType = Height;
113 
114  public:
115  static auto GetKeyFromValue(const ValueType& heightNamespaces) {
116  return heightNamespaces.key();
117  }
118  };
119 
120  // endregion
121 
122  public:
126 
127  public:
130  };
131 }}
RootNamespaceHistory.h
catapult::cache::BasicNamespaceCacheDelta
Basic delta on top of the namespace cache.
Definition: NamespaceCacheDelta.h:53
catapult::cache::NamespaceBaseSetDeltaPointers
Definition: NamespaceBaseSets.h:41
catapult::cache::NamespaceCache
Synchronized cache composed of namespace information.
Definition: NamespaceCache.h:71
catapult::cache::NamespaceCacheDescriptor
Describes a namespace cache.
Definition: NamespaceCacheTypes.h:53
catapult::cache::NamespaceCacheTypes::Options::GracePeriodDuration
BlockDuration GracePeriodDuration
Namespace grace period duration.
Definition: NamespaceCacheTypes.h:89
catapult::state::Namespace
A catapult namespace.
Definition: Namespace.h:30
IdentifierGroup.h
catapult::cache::NamespaceCacheDescriptor::GetKeyFromValue
static auto GetKeyFromValue(const ValueType &history)
Gets the key corresponding to history.
Definition: NamespaceCacheTypes.h:72
Namespace.h
catapult::state::Namespace::id
NamespaceId id() const
Gets the namespace id.
Definition: Namespace.h:43
catapult::utils::IdentifierGroup::key
const TGroupingKey & key() const
Gets the grouping key.
Definition: IdentifierGroup.h:43
catapult::Height
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
catapult::NamespaceId
utils::BaseValue< uint64_t, NamespaceId_tag > NamespaceId
Definition: plugins/txes/namespace/src/types.h:28
catapult::state::NamespaceEntry
A pair composed of a namespace and its root.
Definition: NamespaceEntry.h:28
catapult::state::RootNamespaceHistory
A root namespace history.
Definition: RootNamespaceHistory.h:31
catapult::cache::ReadOnlyArtifactCache
A read-only overlay on top of a cache that provides support for contains, get and isActive.
Definition: MosaicCacheTypes.h:42
catapult::cache::NamespaceBaseSets
Definition: NamespaceBaseSets.h:48
catapult::utils::BaseValue< uint64_t, NamespaceId_tag >
catapult::cache::NamespaceCacheTypes::HeightGroupingTypesDescriptor::GetKeyFromValue
static auto GetKeyFromValue(const ValueType &heightNamespaces)
Definition: NamespaceCacheTypes.h:115
catapult::cache::NamespaceCacheDelta
Delta on top of the namespace cache.
Definition: NamespaceCacheDelta.h:101
catapult::cache::NamespaceCacheTypes::FlatMapTypesDescriptor::GetKeyFromValue
static auto GetKeyFromValue(const ValueType &ns)
Definition: NamespaceCacheTypes.h:102
catapult::cache::BasicNamespaceCacheView
Basic view on top of the namespace cache.
Definition: NamespaceCacheView.h:50
catapult::cache::NamespaceCacheTypes
Namespace cache types.
Definition: NamespaceCacheTypes.h:78
CacheDatabaseMixin.h
catapult::cache::NamespacePatriciaTree
Definition: NamespaceBaseSets.h:35
CacheDescriptorAdapters.h
catapult::cache::NamespaceHeightGroupingSerializer
Serializer for namespace cache height grouped elements.
Definition: NamespaceCacheSerializers.h:59
catapult::cache::NamespaceCacheTypes::FlatMapTypesDescriptor
Definition: NamespaceCacheTypes.h:95
catapult::cache::NamespaceFlatMapTypesSerializer
Serializer for namespace flat map sub cache.
Definition: NamespaceCacheSerializers.h:41
catapult::cache::NamespaceCacheTypes::HeightGroupingTypesDescriptor
Definition: NamespaceCacheTypes.h:108
catapult::cache::RootNamespaceHistoryPrimarySerializer
Primary serializer for namespace cache.
Definition: NamespaceCacheSerializers.h:30
catapult
Definition: AddressExtractionExtension.cpp:28
Hashers.h
NamespaceEntry.h
catapult::cache::NamespaceCacheTypes::Options
Custom sub view options.
Definition: NamespaceCacheTypes.h:87
BaseSetDelta.h
catapult::cache::CacheId::Namespace
catapult::cache::NamespaceCacheDescriptor::Name
static constexpr auto Name
Definition: NamespaceCacheTypes.h:55
catapult::state::RootNamespaceHistory::id
NamespaceId id() const
Gets the id of the root namespace history.
Definition: RootNamespaceHistory.cpp:59
catapult::cache::NamespaceCacheView
View on top of the namespace cache.
Definition: NamespaceCacheView.h:77
catapult::utils::IdentifierGroup
A group of identifiers that share a common (external) attribute.
Definition: IdentifierGroup.h:28
catapult::cache::detail::UnorderedMapAdapter
Defines cache types for an unordered map based cache.
Definition: CacheDescriptorAdapters.h:35