CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
28 #include <unordered_map>
30 namespace catapult {
namespace cache {
34 template<
typename TElementTraits,
typename TDescriptor,
typename TValueHasher>
39 using KeyType =
typename TDescriptor::KeyType;
51 return element.second;
55 return StorageType(TDescriptor::GetKeyFromValue(value), value);
60 using MemoryMapType = std::unordered_map<typename TDescriptor::KeyType, typename TDescriptor::ValueType, TValueHasher>;
63 static constexpr
auto ToKey = TDescriptor::GetKeyFromValue;
92 template<
typename TDescriptor,
typename TValueHasher = std::hash<
typename TDescriptor::KeyType>>
99 template<
typename TDescriptor,
typename TValueHasher = std::hash<
typename TDescriptor::KeyType>>
107 template<
typename TElementTraits>
110 using ElementType = std::remove_const_t<typename TElementTraits::ElementType>;
145 template<
typename TDescriptor>
150 template<
typename TDescriptor>
156 template<
typename TElementTraits,
typename TDescriptor>
161 using KeyType =
typename TDescriptor::KeyType;
181 using ElementType = std::remove_const_t<typename TElementTraits::ElementType>;
210 template<
typename TDescriptor>
216 template<
typename TDescriptor>
static constexpr auto & ToValue(const StorageType &element)
Definition: CacheDescriptorAdapters.h:172
Defines cache types for an ordered, memory backed set based cache.
Definition: CacheDescriptorAdapters.h:108
Base set compatible traits for stl set types.
Definition: BaseSetDefaultTraits.h:60
typename BaseSetType::DeltaType BaseSetDeltaType
Base set delta type.
Definition: CacheDescriptorAdapters.h:137
static constexpr auto ToKey
Definition: CacheDescriptorAdapters.h:63
CacheContainerView< DescriptorAdapter > StorageSetType
Definition: CacheDescriptorAdapters.h:182
Definition: CacheDescriptorAdapters.h:62
std::remove_const_t< typename TElementTraits::ElementType > ElementType
Definition: CacheDescriptorAdapters.h:181
Traits used for describing an immutable type.
Definition: BaseSetDefaultTraits.h:166
typename BaseSetType::DeltaType BaseSetDeltaType
Base set delta type.
Definition: CacheDescriptorAdapters.h:84
BaseSetDelta< TElementTraits, TSetTraits > DeltaType
Definition: BaseSet.h:58
Defines cache types for an ordered set based cache.
Definition: CacheDescriptorAdapters.h:157
typename TDescriptor::Serializer Serializer
Definition: CacheDescriptorAdapters.h:164
A base set with ordered keys.
Definition: OrderedSet.h:59
static constexpr auto & ToValue(const StorageType &element)
Definition: CacheDescriptorAdapters.h:50
Traits used for describing a mutable type.
Definition: BaseSetDefaultTraits.h:152
Base set compatible traits for stl map types.
Definition: BaseSetDefaultTraits.h:96
std::unordered_map< typename TDescriptor::KeyType, typename TDescriptor::ValueType, TValueHasher > MemoryMapType
Definition: CacheDescriptorAdapters.h:60
CacheContainerView< DescriptorAdapter > StorageMapType
Definition: CacheDescriptorAdapters.h:59
typename TDescriptor::Serializer Serializer
Definition: CacheDescriptorAdapters.h:42
typename TDescriptor::KeyType KeyType
Definition: CacheDescriptorAdapters.h:161
std::remove_const_t< typename TElementTraits::ElementType > ElementType
Definition: CacheDescriptorAdapters.h:110
Definition: CacheDescriptorAdapters.h:37
std::pair< const KeyType, ValueType > StorageType
Definition: CacheDescriptorAdapters.h:41
std::set< ElementType > MemorySetType
Definition: CacheDescriptorAdapters.h:183
std::set< std::remove_const_t< typename T::ElementType >, std::less< typename T::ElementType > > OrderedSetType
Definition: OrderedSet.h:39
std::shared_ptr< BaseSetDeltaType > BaseSetDeltaPointerType
Base set delta pointer type.
Definition: CacheDescriptorAdapters.h:205
std::shared_ptr< BaseSetDeltaType > BaseSetDeltaPointerType
Base set delta pointer type.
Definition: CacheDescriptorAdapters.h:140
Definition: CacheDescriptorAdapters.h:112
RocksDb-backed database.
Definition: RocksDatabase.h:116
static constexpr auto & ToStorage(const ValueType &value)
Definition: CacheDescriptorAdapters.h:176
static constexpr auto GetKeyFromValue
Definition: CacheDescriptorAdapters.h:166
Definition: CacheDescriptorAdapters.h:195
Key-related traits for stl set types.
Definition: BaseSetDefaultTraits.h:34
static auto ToStorage(const ValueType &value)
Definition: CacheDescriptorAdapters.h:54
static constexpr auto & ToKey(const StorageType &element)
Definition: CacheDescriptorAdapters.h:46
std::set< ElementType > MemorySetType
Definition: CacheDescriptorAdapters.h:118
typename BaseSetType::DeltaType BaseSetDeltaType
Base set delta type.
Definition: CacheDescriptorAdapters.h:202
std::shared_ptr< BaseSetDeltaType > BaseSetDeltaPointerType
Base set delta pointer type.
Definition: CacheDescriptorAdapters.h:87
typename TDescriptor::ValueType ValueType
Definition: CacheDescriptorAdapters.h:162
Definition: AddressExtractionExtension.cpp:28
typename TDescriptor::ValueType ValueType
Definition: CacheDescriptorAdapters.h:40
Key-related traits for stl map types.
Definition: BaseSetDefaultTraits.h:47
A conditional container that delegates to either a storage or a memory backed container.
Definition: ConditionalContainer.h:53
static constexpr auto & ToKey(const StorageType &element)
Definition: CacheDescriptorAdapters.h:168
Definition: CacheDescriptorAdapters.h:77
Definition: CacheDescriptorAdapters.h:130
StorageSetType(CacheDatabase &, size_t)
Definition: CacheDescriptorAdapters.h:114
typename TDescriptor::KeyType StorageType
Definition: CacheDescriptorAdapters.h:163
Typed container adapter that wraps column.
Definition: RdbTypedColumnContainer.h:32
Definition: CacheDescriptorAdapters.h:159
static constexpr auto GetKeyFromValue
Definition: CacheDescriptorAdapters.h:44
typename TDescriptor::KeyType KeyType
Definition: CacheDescriptorAdapters.h:39
Defines cache types for an unordered map based cache.
Definition: CacheDescriptorAdapters.h:35