Kagome
Polkadot Runtime Engine in C++17
module_repository_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_RUNTIME_MODULE_REPOSITORY_IMPL_HPP
7 #define KAGOME_CORE_RUNTIME_MODULE_REPOSITORY_IMPL_HPP
8 
10 
11 #include <thread>
12 #include <unordered_map>
13 
14 #include "log/logger.hpp"
16 
17 namespace kagome::runtime {
18  class RuntimeUpgradeTracker;
19  class ModuleFactory;
20  class SingleModuleCache;
21  class RuntimeInstancesPool;
22 
23  class ModuleRepositoryImpl final : public ModuleRepository {
24  public:
26  std::shared_ptr<RuntimeInstancesPool> runtime_instances_pool,
27  std::shared_ptr<RuntimeUpgradeTracker> runtime_upgrade_tracker,
28  std::shared_ptr<const ModuleFactory> module_factory,
29  std::shared_ptr<SingleModuleCache> last_compiled_module);
30 
31  outcome::result<std::shared_ptr<ModuleInstance>> getInstanceAt(
32  std::shared_ptr<const RuntimeCodeProvider> code_provider,
33  const primitives::BlockInfo &block,
34  const primitives::BlockHeader &header) override;
35 
36  private:
37  std::shared_ptr<RuntimeInstancesPool> runtime_instances_pool_;
38  std::shared_ptr<RuntimeUpgradeTracker> runtime_upgrade_tracker_;
39  std::shared_ptr<const ModuleFactory> module_factory_;
40  std::shared_ptr<SingleModuleCache> last_compiled_module_;
42  };
43 
44 } // namespace kagome::runtime
45 
46 #endif // KAGOME_CORE_RUNTIME_MODULE_REPOSITORY_IMPL_HPP
std::shared_ptr< RuntimeUpgradeTracker > runtime_upgrade_tracker_
std::shared_ptr< SingleModuleCache > last_compiled_module_
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
outcome::result< std::shared_ptr< ModuleInstance > > getInstanceAt(std::shared_ptr< const RuntimeCodeProvider > code_provider, const primitives::BlockInfo &block, const primitives::BlockHeader &header) override
Returns a module instance for runtime at the.
ModuleRepositoryImpl(std::shared_ptr< RuntimeInstancesPool > runtime_instances_pool, std::shared_ptr< RuntimeUpgradeTracker > runtime_upgrade_tracker, std::shared_ptr< const ModuleFactory > module_factory, std::shared_ptr< SingleModuleCache > last_compiled_module)
std::shared_ptr< RuntimeInstancesPool > runtime_instances_pool_
std::shared_ptr< const ModuleFactory > module_factory_