Kagome
Polkadot Runtime Engine in C++17
kagome::storage::face::ReadableMap< K, V > Struct Template Referenceabstract

A mixin for read-only map. More...

#include <readable.hpp>

Inheritance diagram for kagome::storage::face::ReadableMap< K, V >:
Collaboration diagram for kagome::storage::face::ReadableMap< K, V >:

Public Types

using Key = K
 
using Value = V
 
using ValueView = std::reference_wrapper< V >
 
using ConstValueView = std::reference_wrapper< const V >
 
- Public Types inherited from kagome::storage::face::ReadableBase< K >
using Key = K
 

Public Member Functions

virtual ~ReadableMap ()=default
 
virtual outcome::result< ConstValueViewget (const Key &key) const =0
 Get value by key. More...
 
virtual outcome::result< std::optional< ConstValueView > > tryGet (const Key &key) const =0
 Get value by key. More...
 
- Public Member Functions inherited from kagome::storage::face::ReadableBase< K >
virtual ~ReadableBase ()=default
 
virtual outcome::result< bool > contains (const Key &key) const =0
 Checks if given key-value binding exists in the storage. More...
 
virtual bool empty () const =0
 Returns true if the storage is empty. More...
 

Detailed Description

template<typename K, typename V>
struct kagome::storage::face::ReadableMap< K, V >

A mixin for read-only map.

Template Parameters
Kkey type
Vvalue type

Definition at line 40 of file readable.hpp.

Member Typedef Documentation

template<typename K, typename V>
using kagome::storage::face::ReadableMap< K, V >::ConstValueView = std::reference_wrapper<const V>

Definition at line 44 of file readable.hpp.

template<typename K, typename V>
using kagome::storage::face::ReadableMap< K, V >::Key = K

Definition at line 41 of file readable.hpp.

template<typename K, typename V>
using kagome::storage::face::ReadableMap< K, V >::Value = V

Definition at line 42 of file readable.hpp.

template<typename K, typename V>
using kagome::storage::face::ReadableMap< K, V >::ValueView = std::reference_wrapper<V>

Definition at line 43 of file readable.hpp.

Constructor & Destructor Documentation

template<typename K, typename V>
virtual kagome::storage::face::ReadableMap< K, V >::~ReadableMap ( )
virtualdefault

Member Function Documentation

template<typename K, typename V>
virtual outcome::result<ConstValueView> kagome::storage::face::ReadableMap< K, V >::get ( const Key key) const
pure virtual
template<typename K, typename V>
virtual outcome::result<std::optional<ConstValueView> > kagome::storage::face::ReadableMap< K, V >::tryGet ( const Key key) const
pure virtual

The documentation for this struct was generated from the following file: