hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
yac_network_interface.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_YAC_NETWORK_INTERFACE_HPP
7 #define IROHA_YAC_NETWORK_INTERFACE_HPP
8 
9 #include <memory>
10 #include <vector>
11 
12 namespace shared_model {
13  namespace interface {
14  class Peer;
15  } // namespace interface
16 } // namespace shared_model
17 
18 namespace iroha {
19  namespace consensus {
20  namespace yac {
21 
22  struct VoteMessage;
23 
25  public:
30  virtual void onState(std::vector<VoteMessage> state) = 0;
31 
32  virtual ~YacNetworkNotifications() = default;
33  };
34 
35  class YacNetwork {
36  public:
37  virtual void subscribe(
38  std::shared_ptr<YacNetworkNotifications> handler) = 0;
39 
45  virtual void sendState(const shared_model::interface::Peer &to,
46  const std::vector<VoteMessage> &state) = 0;
47 
51  virtual ~YacNetwork() = default;
52  };
53  } // namespace yac
54  } // namespace consensus
55 } // namespace iroha
56 
57 #endif // IROHA_YAC_NETWORK_INTERFACE_HPP
Definition: yac_network_interface.hpp:35
Definition: peer.hpp:18
Definition: block_query.hpp:16
Definition: command_executor.hpp:12
Definition: yac_network_interface.hpp:24