Kagome
Polkadot Runtime Engine in C++17
generic_maps.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_GENERIC_MAPS_HPP
7 #define KAGOME_GENERIC_MAPS_HPP
8 
13 
14 namespace kagome::storage::face {
15 
21  template <typename K, typename V, typename KView = K>
22  struct ReadOnlyMap
23  : public Iterable<K, typename ReadableMap<K, V>::ConstValueView, KView>,
24  public ReadableMap<KView, V> {};
25 
26  template <typename K, typename V, typename KView = K>
27  struct ReadOnlyStorage : public Iterable<K, V, KView>,
28  public ReadableStorage<KView, V> {};
29 
35  template <typename K, typename V, typename KView = K>
36  struct GenericMap : public ReadOnlyMap<K, V, KView>,
37  public Writeable<KView, V>,
38  public BatchWriteable<KView, V> {};
39 
40  template <typename K, typename V, typename KView = K>
41  struct GenericStorage : public ReadOnlyStorage<K, V, KView>,
42  public Writeable<KView, V>,
43  public BatchWriteable<KView, V> {
48  virtual size_t size() const = 0;
49  };
50 
51 } // namespace kagome::storage::face
52 
53 #endif // KAGOME_GENERIC_MAPS_HPP
A mixin for read-only map.
Definition: readable.hpp:40
An abstraction over a readable and iterable key-value map.
A mixin for an iterable map.
Definition: iterable.hpp:22
An mixin for modifiable map.
Definition: writeable.hpp:19
A mixin for a map that supports batching for efficiency of modifications.
An abstraction over a readable, writeable, iterable key-value map.