hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
mutable_factory.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_MUTABLE_FACTORY_HPP
7 #define IROHA_MUTABLE_FACTORY_HPP
8 
9 #include <memory>
10 
11 #include <boost/optional.hpp>
14 #include "common/result.hpp"
15 
16 namespace shared_model {
17  namespace interface {
18  class Block;
19  }
20 } // namespace shared_model
21 
22 namespace iroha {
23  namespace ametsuchi {
24 
25  class MutableStorage;
26 
28  public:
34  virtual std::unique_ptr<MutableStorage> createMutableStorage(
35  std::shared_ptr<CommandExecutor> command_executor) = 0;
36 
44  virtual CommitResult commit(
45  std::unique_ptr<MutableStorage> mutableStorage) = 0;
46 
48  virtual bool preparedCommitEnabled() const = 0;
49 
55  virtual CommitResult commitPrepared(
56  std::shared_ptr<const shared_model::interface::Block> block) = 0;
57 
58  virtual ~MutableFactory() = default;
59  };
60 
61  } // namespace ametsuchi
62 } // namespace iroha
63 #endif // IROHA_MUTABLE_FACTORY_HPP
iroha::expected::Result< std::shared_ptr< const iroha::LedgerState >, std::string > CommitResult
Definition: commit_result.hpp:20
Definition: block_query.hpp:14
Definition: command_executor.hpp:12
Definition: mutable_factory.hpp:27