2014-12-09 17:45:33 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef FSPP_BLOBSTORE_BLOBSTORE_H_
|
|
|
|
#define FSPP_BLOBSTORE_BLOBSTORE_H_
|
|
|
|
|
|
|
|
#include "Blob.h"
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
|
2015-02-17 00:40:34 +01:00
|
|
|
#include "messmer/blockstore/utils/Key.h"
|
2014-12-09 17:45:33 +01:00
|
|
|
|
|
|
|
namespace blobstore {
|
|
|
|
|
|
|
|
class BlobStore {
|
|
|
|
public:
|
|
|
|
virtual ~BlobStore() {}
|
|
|
|
|
2014-12-13 19:17:08 +01:00
|
|
|
virtual std::unique_ptr<Blob> create() = 0;
|
2014-12-09 17:45:33 +01:00
|
|
|
//TODO Use boost::optional (if key doesn't exist)
|
|
|
|
// Return nullptr if block with this key doesn't exists
|
2014-12-13 19:17:08 +01:00
|
|
|
virtual std::unique_ptr<Blob> load(const blockstore::Key &key) = 0;
|
2014-12-09 17:45:33 +01:00
|
|
|
//TODO Needed for performance? Or is deleting loaded blocks enough?
|
|
|
|
//virtual void remove(const std::string &key) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|