Kagome
Polkadot Runtime Engine in C++17
kagome::runtime::binaryen::ModuleImpl Class Referencefinal

#include <module_impl.hpp>

Inheritance diagram for kagome::runtime::binaryen::ModuleImpl:
Collaboration diagram for kagome::runtime::binaryen::ModuleImpl:

Public Types

enum  Error { Error::EMPTY_STATE_CODE = 1, Error::INVALID_STATE_CODE }
 

Public Member Functions

 ModuleImpl (ModuleImpl &&)=default
 
ModuleImploperator= (ModuleImpl &&)=delete
 
 ModuleImpl (const ModuleImpl &)=delete
 
ModuleImploperator= (const ModuleImpl &)=delete
 
 ~ModuleImpl () override=default
 
outcome::result< std::shared_ptr< ModuleInstance > > instantiate () const override
 
- Public Member Functions inherited from kagome::runtime::Module
virtual ~Module ()=default
 

Static Public Member Functions

static outcome::result< std::unique_ptr< ModuleImpl > > createFromCode (const std::vector< uint8_t > &code, std::shared_ptr< const InstanceEnvironmentFactory > env_factory_, const common::Hash256 &code_hash)
 

Static Public Attributes

static constexpr auto kDefaultHeappages = 1024
 

Private Member Functions

 ModuleImpl (std::unique_ptr< wasm::Module > &&module, std::shared_ptr< const InstanceEnvironmentFactory > env_factory, const common::Hash256 &code_hash)
 

Private Attributes

std::shared_ptr< const InstanceEnvironmentFactoryenv_factory_
 
std::shared_ptr< wasm::Module > module_
 
const common::Hash256 code_hash_
 

Detailed Description

Stores a wasm::Module and a wasm::Module instance which contains the module and the provided runtime external interface

Definition at line 32 of file module_impl.hpp.

Member Enumeration Documentation

Enumerator
EMPTY_STATE_CODE 
INVALID_STATE_CODE 

Definition at line 36 of file module_impl.hpp.

Constructor & Destructor Documentation

kagome::runtime::binaryen::ModuleImpl::ModuleImpl ( ModuleImpl &&  )
default
kagome::runtime::binaryen::ModuleImpl::ModuleImpl ( const ModuleImpl )
delete
kagome::runtime::binaryen::ModuleImpl::~ModuleImpl ( )
overridedefault
kagome::runtime::binaryen::ModuleImpl::ModuleImpl ( std::unique_ptr< wasm::Module > &&  module,
std::shared_ptr< const InstanceEnvironmentFactory env_factory,
const common::Hash256 code_hash 
)
private

Definition at line 35 of file module_impl.cpp.

Member Function Documentation

outcome::result< std::unique_ptr< ModuleImpl > > kagome::runtime::binaryen::ModuleImpl::createFromCode ( const std::vector< uint8_t > &  code,
std::shared_ptr< const InstanceEnvironmentFactory env_factory_,
const common::Hash256 code_hash 
)
static

Definition at line 46 of file module_impl.cpp.

outcome::result< std::shared_ptr< ModuleInstance > > kagome::runtime::binaryen::ModuleImpl::instantiate ( ) const
overridevirtual

Implements kagome::runtime::Module.

Definition at line 81 of file module_impl.cpp.

ModuleImpl& kagome::runtime::binaryen::ModuleImpl::operator= ( ModuleImpl &&  )
delete
ModuleImpl& kagome::runtime::binaryen::ModuleImpl::operator= ( const ModuleImpl )
delete

Member Data Documentation

const common::Hash256 kagome::runtime::binaryen::ModuleImpl::code_hash_
private

Definition at line 61 of file module_impl.hpp.

std::shared_ptr<const InstanceEnvironmentFactory> kagome::runtime::binaryen::ModuleImpl::env_factory_
private

Definition at line 59 of file module_impl.hpp.

constexpr auto kagome::runtime::binaryen::ModuleImpl::kDefaultHeappages = 1024
static

Definition at line 35 of file module_impl.hpp.

std::shared_ptr<wasm::Module> kagome::runtime::binaryen::ModuleImpl::module_
private

Definition at line 60 of file module_impl.hpp.


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