Kagome
Polkadot Runtime Engine in C++17
memory_provider.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_MEMORY_PROVIDER_HPP
7 #define KAGOME_CORE_RUNTIME_MEMORY_PROVIDER_HPP
8 
9 #include <optional>
10 
11 #include "runtime/memory.hpp"
12 
13 namespace kagome::runtime {
14 
15  class Memory;
16 
18  public:
19  virtual ~MemoryProvider() = default;
20 
21  virtual std::optional<std::reference_wrapper<runtime::Memory>>
22  getCurrentMemory() const = 0;
23  [[nodiscard]] virtual outcome::result<void> resetMemory(
24  WasmSize heap_base) = 0;
25  };
26 
27 } // namespace kagome::runtime
28 
29 #endif // KAGOME_CORE_RUNTIME_MEMORY_PROVIDER_HPP
uint32_t WasmSize
Size type is uint32_t because we are working in 32 bit address space.
Definition: types.hpp:35
virtual ~MemoryProvider()=default
virtual outcome::result< void > resetMemory(WasmSize heap_base)=0
virtual std::optional< std::reference_wrapper< runtime::Memory > > getCurrentMemory() const =0