Kagome
Polkadot Runtime Engine in C++17
core_api_factory_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_BINARYEN_CORE_API_FACTORY_IMPL_HPP
7 #define KAGOME_CORE_RUNTIME_BINARYEN_CORE_API_FACTORY_IMPL_HPP
8 
11 
13  class ChangesTracker;
14 }
15 
16 namespace kagome::storage::trie {
17  class TrieStorage;
18 }
19 
20 namespace kagome::blockchain {
21  class BlockHeaderRepository;
22 }
23 
24 namespace kagome::runtime {
25  class TrieStorageProvider;
26  class Memory;
27  class RuntimeEnvironmentFactory;
28  class RuntimePropertiesCache;
29 } // namespace kagome::runtime
30 
31 namespace kagome::runtime::binaryen {
32 
33  class InstanceEnvironmentFactory;
34  class BinaryenMemoryFactory;
35 
36  class CoreApiFactoryImpl final
37  : public runtime::CoreApiFactory,
38  public std::enable_shared_from_this<CoreApiFactoryImpl> {
39  public:
41  std::shared_ptr<const InstanceEnvironmentFactory> instance_env_factory,
42  std::shared_ptr<const blockchain::BlockHeaderRepository> header_repo,
43  std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker,
44  std::shared_ptr<runtime::RuntimePropertiesCache> cache);
45 
46  std::unique_ptr<Core> make(
47  std::shared_ptr<const crypto::Hasher> hasher,
48  const std::vector<uint8_t> &runtime_code) const override;
49 
50  private:
51  std::shared_ptr<const InstanceEnvironmentFactory> instance_env_factory_;
52  std::shared_ptr<const blockchain::BlockHeaderRepository> header_repo_;
53  std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker_;
54  std::shared_ptr<runtime::RuntimePropertiesCache> cache_;
55  };
56 
57 } // namespace kagome::runtime::binaryen
58 
59 #endif // KAGOME_CORE_RUNTIME_BINARYEN_CORE_API_FACTORY_IMPL_HPP
std::shared_ptr< runtime::RuntimePropertiesCache > cache_
std::shared_ptr< storage::changes_trie::ChangesTracker > changes_tracker_
std::shared_ptr< const blockchain::BlockHeaderRepository > header_repo_
std::shared_ptr< const InstanceEnvironmentFactory > instance_env_factory_