hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
on_demand_os_transport.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_ON_DEMAND_OS_TRANSPORT_HPP
7 #define IROHA_ON_DEMAND_OS_TRANSPORT_HPP
8 
9 #include <memory>
10 #include <utility>
11 #include <vector>
12 
13 #include <boost/optional.hpp>
14 #include "consensus/round.hpp"
15 
16 namespace shared_model {
17  namespace interface {
18  class TransactionBatch;
19  class Proposal;
20  class Peer;
21  } // namespace interface
22 } // namespace shared_model
23 
24 namespace iroha {
25  namespace ordering {
26  namespace transport {
27 
32  public:
36  using ProposalType = std::unique_ptr<shared_model::interface::Proposal>;
37 
41  using TransactionBatchType =
42  std::shared_ptr<shared_model::interface::TransactionBatch>;
43 
47  using CollectionType = std::vector<TransactionBatchType>;
48 
54  virtual void onBatches(consensus::Round round,
55  CollectionType batches) = 0;
56 
63  virtual boost::optional<ProposalType> onRequestProposal(
64  consensus::Round round) = 0;
65 
66  virtual ~OdOsNotification() = default;
67  };
68 
73  public:
80  virtual std::unique_ptr<OdOsNotification> create(
81  const shared_model::interface::Peer &to) = 0;
82 
83  virtual ~OdOsNotificationFactory() = default;
84  };
85 
86  } // namespace transport
87  } // namespace ordering
88 } // namespace iroha
89 
90 #endif // IROHA_ON_DEMAND_OS_TRANSPORT_HPP
std::shared_ptr< shared_model::interface::TransactionBatch > TransactionBatchType
Definition: on_demand_os_transport.hpp:42
Definition: peer.hpp:18
Definition: on_demand_os_transport.hpp:72
Definition: block_query.hpp:16
Definition: on_demand_os_transport.hpp:31
std::unique_ptr< shared_model::interface::Proposal > ProposalType
Definition: on_demand_os_transport.hpp:36
Definition: round.hpp:31
Definition: command_executor.hpp:12
std::vector< TransactionBatchType > CollectionType
Definition: on_demand_os_transport.hpp:47