hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
client_factory_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CLIENT_FACTORY_IMPL_HPP
7 #define IROHA_CLIENT_FACTORY_IMPL_HPP
8 
10 
11 #include <memory>
12 
14 
15 namespace iroha {
16  namespace network {
17 
18  template <typename Service>
19  class ClientFactoryImpl : public ClientFactory<Service> {
20  public:
22  std::shared_ptr<const GenericClientFactory> generic_factory)
23  : generic_factory_(std::move(generic_factory)) {}
24 
25  iroha::expected::Result<std::unique_ptr<typename Service::StubInterface>,
26  std::string>
27  createClient(const shared_model::interface::Peer &peer) const override {
28  return generic_factory_->createClient<Service>(peer);
29  }
30 
31  private:
32  std::shared_ptr<const GenericClientFactory> generic_factory_;
33  };
34 
35  } // namespace network
36 } // namespace iroha
37 
38 #endif
iroha::expected::Result< std::unique_ptr< typename Service::StubInterface >, std::string > createClient(const shared_model::interface::Peer &peer) const override
Definition: client_factory_impl.hpp:27
Definition: peer.hpp:20
Definition: peer.hpp:48
Definition: block_query.hpp:14
Definition: client_factory_impl.hpp:19
ClientFactoryImpl(std::shared_ptr< const GenericClientFactory > generic_factory)
Definition: client_factory_impl.hpp:21
Definition: client_factory.hpp:23