hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
abstract_transport_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_ABSTRACT_TRANSPORT_FACTORY_HPP
7 #define IROHA_ABSTRACT_TRANSPORT_FACTORY_HPP
8 
9 #include <memory>
10 
11 #include "common/result.hpp"
12 #include "cryptography/hash.hpp"
14 
15 namespace shared_model {
16  namespace interface {
17 
18  template <typename Interface, typename Transport>
19  class AbstractTransportFactory {
20  public:
21  struct Error {
23  std::string error;
24  };
25 
26  virtual iroha::expected::Result<std::unique_ptr<Interface>, Error> build(
27  Transport transport) const = 0;
28 
29  virtual ~AbstractTransportFactory() = default;
30  };
31 
32  } // namespace interface
33 } // namespace shared_model
34 
35 #endif // IROHA_ABSTRACT_TRANSPORT_FACTORY_HPP
Definition: hash.hpp:18
Definition: abstract_transport_factory.hpp:21
types::HashType hash
Definition: abstract_transport_factory.hpp:22
std::string error
Definition: abstract_transport_factory.hpp:23
virtual iroha::expected::Result< std::unique_ptr< Interface >, Error > build(Transport transport) const =0
Definition: command_executor.hpp:12