Skip to content
Snippets Groups Projects
storage.hh 644 B
Newer Older
  • Learn to ignore specific revisions
  • Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
    #ifndef __VEREIGN_KVSTORE_STORAGE_HH
    #define __VEREIGN_KVSTORE_STORAGE_HH
    
    #include <vereign/bytes/buffer.hh>
    
    namespace vereign::kvstore {
    
    class Storage {
    public:
    
      virtual void Lock() = 0;
      virtual void Unlock() = 0;
    
    
      virtual void DeleteAll() = 0;
    
    
    Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
      virtual void PutBytes(const std::string& key, bytes::View value) = 0;
      virtual void GetBytes(const std::string& key, bytes::Buffer& value) = 0;
    
      virtual void PutInt64(const std::string& key, int64_t value) = 0;
      virtual auto GetInt64(const std::string& key) -> int64_t = 0;
    
      virtual ~Storage() = default;
    };
    
    } // namespace vereign::kvstore
    
    #endif // __VEREIGN_KVSTORE_STORAGE_HH