Kagome
Polkadot Runtime Engine in C++17
kagome::storage::trie::TrieStorageImpl Class Reference

#include <trie_storage_impl.hpp>

Inheritance diagram for kagome::storage::trie::TrieStorageImpl:
Collaboration diagram for kagome::storage::trie::TrieStorageImpl:

Public Member Functions

 TrieStorageImpl (TrieStorageImpl const &)=delete
 
void operator= (const TrieStorageImpl &)=delete
 
 TrieStorageImpl (TrieStorageImpl &&)=default
 
TrieStorageImploperator= (TrieStorageImpl &&)=default
 
 ~TrieStorageImpl () override=default
 
outcome::result< std::unique_ptr< PersistentTrieBatch > > getPersistentBatchAt (const RootHash &root) override
 
outcome::result< std::unique_ptr< EphemeralTrieBatch > > getEphemeralBatchAt (const RootHash &root) const override
 
- Public Member Functions inherited from kagome::storage::trie::TrieStorage
virtual ~TrieStorage ()=default
 

Static Public Member Functions

static outcome::result< std::unique_ptr< TrieStorageImpl > > createEmpty (const std::shared_ptr< PolkadotTrieFactory > &trie_factory, std::shared_ptr< Codec > codec, std::shared_ptr< TrieSerializer > serializer, std::optional< std::shared_ptr< changes_trie::ChangesTracker >> changes)
 
static outcome::result< std::unique_ptr< TrieStorageImpl > > createFromStorage (std::shared_ptr< Codec > codec, std::shared_ptr< TrieSerializer > serializer, std::optional< std::shared_ptr< changes_trie::ChangesTracker >> changes)
 

Protected Member Functions

 TrieStorageImpl (std::shared_ptr< Codec > codec, std::shared_ptr< TrieSerializer > serializer, std::optional< std::shared_ptr< changes_trie::ChangesTracker >> changes)
 

Private Attributes

std::shared_ptr< Codeccodec_
 
std::shared_ptr< TrieSerializerserializer_
 
std::optional< std::shared_ptr< changes_trie::ChangesTracker > > changes_
 
log::Logger logger_
 

Detailed Description

Definition at line 20 of file trie_storage_impl.hpp.

Constructor & Destructor Documentation

kagome::storage::trie::TrieStorageImpl::TrieStorageImpl ( TrieStorageImpl const &  )
delete
kagome::storage::trie::TrieStorageImpl::TrieStorageImpl ( TrieStorageImpl &&  )
default
kagome::storage::trie::TrieStorageImpl::~TrieStorageImpl ( )
overridedefault
kagome::storage::trie::TrieStorageImpl::TrieStorageImpl ( std::shared_ptr< Codec codec,
std::shared_ptr< TrieSerializer serializer,
std::optional< std::shared_ptr< changes_trie::ChangesTracker >>  changes 
)
protected

Definition at line 40 of file trie_storage_impl.cpp.

Member Function Documentation

outcome::result< std::unique_ptr< TrieStorageImpl > > kagome::storage::trie::TrieStorageImpl::createEmpty ( const std::shared_ptr< PolkadotTrieFactory > &  trie_factory,
std::shared_ptr< Codec codec,
std::shared_ptr< TrieSerializer serializer,
std::optional< std::shared_ptr< changes_trie::ChangesTracker >>  changes 
)
static

Definition at line 17 of file trie_storage_impl.cpp.

outcome::result< std::unique_ptr< TrieStorageImpl > > kagome::storage::trie::TrieStorageImpl::createFromStorage ( std::shared_ptr< Codec codec,
std::shared_ptr< TrieSerializer serializer,
std::optional< std::shared_ptr< changes_trie::ChangesTracker >>  changes 
)
static

Definition at line 32 of file trie_storage_impl.cpp.

outcome::result< std::unique_ptr< EphemeralTrieBatch > > kagome::storage::trie::TrieStorageImpl::getEphemeralBatchAt ( const RootHash root) const
overridevirtual

Implements kagome::storage::trie::TrieStorage.

Definition at line 65 of file trie_storage_impl.cpp.

outcome::result< std::unique_ptr< PersistentTrieBatch > > kagome::storage::trie::TrieStorageImpl::getPersistentBatchAt ( const RootHash root)
overridevirtual

Initializes a batch at the provided state

Warning
if the batch is committed, the trie will still switch to its state, creating a 'fork'

Implements kagome::storage::trie::TrieStorage.

Definition at line 55 of file trie_storage_impl.cpp.

void kagome::storage::trie::TrieStorageImpl::operator= ( const TrieStorageImpl )
delete
TrieStorageImpl& kagome::storage::trie::TrieStorageImpl::operator= ( TrieStorageImpl &&  )
default

Member Data Documentation

std::optional<std::shared_ptr<changes_trie::ChangesTracker> > kagome::storage::trie::TrieStorageImpl::changes_
private

Definition at line 54 of file trie_storage_impl.hpp.

std::shared_ptr<Codec> kagome::storage::trie::TrieStorageImpl::codec_
private

Definition at line 52 of file trie_storage_impl.hpp.

log::Logger kagome::storage::trie::TrieStorageImpl::logger_
private

Definition at line 55 of file trie_storage_impl.hpp.

std::shared_ptr<TrieSerializer> kagome::storage::trie::TrieStorageImpl::serializer_
private

Definition at line 53 of file trie_storage_impl.hpp.


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