Kagome
Polkadot Runtime Engine in C++17
instance_environment_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_BINARYEN_INSTANCE_ENVIRONMENT_FACTORY_HPP
7 #define KAGOME_CORE_RUNTIME_BINARYEN_INSTANCE_ENVIRONMENT_FACTORY_HPP
8 
10 
11 namespace kagome::storage::trie {
12  class TrieStorage;
13  class TrieSerializer;
14 } // namespace kagome::storage::trie
15 
17  class ChangesTracker;
18 }
19 
20 namespace kagome::host_api {
21  class HostApiFactory;
22 }
23 
24 namespace kagome::blockchain {
25  class BlockHeaderRepository;
26 }
27 
28 namespace kagome::runtime {
29  class RuntimePropertiesCache;
30 }
31 
32 namespace kagome::runtime::binaryen {
33 
34  class RuntimeExternalInterface;
35 
38  std::shared_ptr<RuntimeExternalInterface> rei;
39  };
40 
42  : public std::enable_shared_from_this<InstanceEnvironmentFactory> {
43  public:
45  std::shared_ptr<storage::trie::TrieStorage> storage,
46  std::shared_ptr<storage::trie::TrieSerializer> serializer,
47  std::shared_ptr<host_api::HostApiFactory> host_api_factory,
48  std::shared_ptr<blockchain::BlockHeaderRepository> block_header_repo,
49  std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker,
50  std::shared_ptr<RuntimePropertiesCache> cache);
51 
52  [[nodiscard]] BinaryenInstanceEnvironment make() const;
53 
54  private:
55  std::shared_ptr<storage::trie::TrieStorage> storage_;
56  std::shared_ptr<storage::trie::TrieSerializer> serializer_;
57  std::shared_ptr<host_api::HostApiFactory> host_api_factory_;
58  std::shared_ptr<blockchain::BlockHeaderRepository> block_header_repo_;
59  std::shared_ptr<storage::changes_trie::ChangesTracker> changes_tracker_;
60  std::shared_ptr<RuntimePropertiesCache> cache_;
61  };
62 
63 } // namespace kagome::runtime::binaryen
64 
65 #endif // KAGOME_CORE_RUNTIME_BINARYEN_INSTANCE_ENVIRONMENT_FACTORY_HPP
std::shared_ptr< blockchain::BlockHeaderRepository > block_header_repo_
std::shared_ptr< storage::changes_trie::ChangesTracker > changes_tracker_
std::shared_ptr< storage::trie::TrieStorage > storage_
std::shared_ptr< storage::trie::TrieSerializer > serializer_
std::shared_ptr< host_api::HostApiFactory > host_api_factory_