Kagome
Polkadot Runtime Engine in C++17
kagome::runtime::SingleModuleCache Class Reference

#include <module.hpp>

Collaboration diagram for kagome::runtime::SingleModuleCache:

Public Member Functions

void set (std::shared_ptr< Module > module)
 Sets new cached value, scrapping previous if any. More...
 
std::optional< std::shared_ptr< Module > > try_extract ()
 

Private Attributes

std::optional< std::shared_ptr< Module > > module_
 

Detailed Description

A wrapper for compiled module. Used when we update WAVM runtime in order to skip double compilation which takes significant time (see issue #1104). Currently it's shared through DI.

Definition at line 37 of file module.hpp.

Member Function Documentation

void kagome::runtime::SingleModuleCache::set ( std::shared_ptr< Module module)
inline

Sets new cached value, scrapping previous if any.

Parameters
moduleNew compiled module to store

Definition at line 43 of file module.hpp.

std::optional<std::shared_ptr<Module> > kagome::runtime::SingleModuleCache::try_extract ( )
inline

Pops stored module (if any), clears cache in process.

Returns
Value if any, std::nullopt otherwise.

Definition at line 51 of file module.hpp.

Member Data Documentation

std::optional<std::shared_ptr<Module> > kagome::runtime::SingleModuleCache::module_
private

Definition at line 58 of file module.hpp.


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