Added size parameters to blobstore interface

This commit is contained in:
Sebastian Messmer 2014-12-05 06:06:05 +01:00
parent 90c49dabc6
commit a43359c3b0
2 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,8 @@
#ifndef BLOBSTORE_INTERFACE_BLOB_H_
#define BLOBSTORE_INTERFACE_BLOB_H_
#include <cstring>
namespace blobstore {
class Blob {
@ -10,6 +12,8 @@ public:
virtual void *data() = 0;
virtual const void *data() const = 0;
virtual size_t size() const = 0;
};
}

View File

@ -14,7 +14,7 @@ class BlobStore {
public:
virtual ~BlobStore() {}
virtual std::unique_ptr<Blob> create(const std::string &key) = 0;
virtual std::unique_ptr<Blob> create(const std::string &key, size_t size) = 0;
virtual std::unique_ptr<Blob> load(const std::string &key) = 0;
//TODO Needed for performance? Or is deleting loaded blobs enough?
//virtual void remove(const std::string &key) = 0;