hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
key_value_storage.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_KV_STORAGE_HPP
7 #define IROHA_KV_STORAGE_HPP
8 
9 #include <boost/optional.hpp>
10 #include <string>
11 #include <vector>
12 
13 namespace iroha {
14 
15  namespace ametsuchi {
16 
21  public:
25  using Identifier = uint32_t;
26  using Bytes = std::vector<uint8_t>;
27 
33  virtual bool add(Identifier id, const Bytes &blob) = 0;
34 
40  virtual boost::optional<Bytes> get(Identifier id) const = 0;
41 
45  virtual std::string directory() const = 0;
46 
50  virtual Identifier last_id() const = 0;
51 
52  virtual void dropAll() = 0;
53 
54  virtual ~KeyValueStorage() = default;
55  };
56  } // namespace ametsuchi
57 } // namespace iroha
58 
59 #endif // IROHA_KV_STORAGE_HPP
uint32_t Identifier
Definition: key_value_storage.hpp:25
virtual ~KeyValueStorage()=default
virtual Identifier last_id() const =0
virtual bool add(Identifier id, const Bytes &blob)=0
std::vector< uint8_t > Bytes
Definition: key_value_storage.hpp:26
Definition: block_query.hpp:14
virtual std::string directory() const =0
Definition: key_value_storage.hpp:20