hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
client_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CLIENT_FACTORY_HPP
7 #define IROHA_CLIENT_FACTORY_HPP
8 
9 #include <memory>
10 
11 #include "common/result.hpp"
12 
13 namespace shared_model {
14  namespace interface {
15  class Peer;
16  }
17 } // namespace shared_model
18 
19 namespace iroha {
20  namespace network {
21 
22  template <typename Service>
23  class ClientFactory {
24  public:
25  virtual ~ClientFactory() = default;
26 
27  virtual iroha::expected::
28  Result<std::unique_ptr<typename Service::StubInterface>, std::string>
29  createClient(const shared_model::interface::Peer &peer) const = 0;
30  };
31 
32  } // namespace network
33 } // namespace iroha
34 
35 #endif
Definition: peer.hpp:20
Definition: block_query.hpp:14
Definition: command_executor.hpp:12
Definition: client_factory.hpp:23
auto createClient(const grpc::string &address)
Definition: grpc_channel_builder.hpp:80