hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
postgres_block_storage_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_POSTGRES_BLOCK_STORAGE_FACTORY_HPP
7 #define IROHA_POSTGRES_BLOCK_STORAGE_FACTORY_HPP
8 
10 
12 #include "logger/logger_fwd.hpp"
13 
14 namespace iroha {
15  namespace ametsuchi {
17  public:
19  std::shared_ptr<PoolWrapper> pool_wrapper,
20  std::shared_ptr<shared_model::proto::ProtoBlockFactory> block_factory,
21  std::function<std::string()> table_name_provider,
22  logger::LoggerPtr log);
23  std::unique_ptr<BlockStorage> create() override;
24 
25  static iroha::expected::Result<void, std::string> createTable(
26  soci::session &sql, const std::string &table);
27 
28  private:
29  std::shared_ptr<PoolWrapper> pool_wrapper_;
30  std::shared_ptr<shared_model::proto::ProtoBlockFactory> block_factory_;
31  std::function<std::string()> table_name_provider_;
32  logger::LoggerPtr log_;
33  };
34  } // namespace ametsuchi
35 } // namespace iroha
36 
37 #endif // IROHA_POSTGRES_BLOCK_STORAGE_FACTORY_HPP
static const model::converters::PbBlockFactory block_factory
Definition: sha3_hash.cpp:15
std::unique_ptr< BlockStorage > create() override
Definition: postgres_block_storage_factory.cpp:22
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Definition: block_query.hpp:14
static iroha::expected::Result< void, std::string > createTable(soci::session &sql, const std::string &table)
Definition: postgres_block_storage_factory.cpp:35
Definition: block_storage_factory.hpp:18
PostgresBlockStorageFactory(std::shared_ptr< PoolWrapper > pool_wrapper, std::shared_ptr< shared_model::proto::ProtoBlockFactory > block_factory, std::function< std::string()> table_name_provider, logger::LoggerPtr log)
Definition: postgres_block_storage_factory.cpp:12
Definition: postgres_block_storage_factory.hpp:16