Added size parameters to blobstore interface
This commit is contained in:
parent
90c49dabc6
commit
a43359c3b0
@ -2,6 +2,8 @@
|
|||||||
#ifndef BLOBSTORE_INTERFACE_BLOB_H_
|
#ifndef BLOBSTORE_INTERFACE_BLOB_H_
|
||||||
#define BLOBSTORE_INTERFACE_BLOB_H_
|
#define BLOBSTORE_INTERFACE_BLOB_H_
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace blobstore {
|
namespace blobstore {
|
||||||
|
|
||||||
class Blob {
|
class Blob {
|
||||||
@ -10,6 +12,8 @@ public:
|
|||||||
|
|
||||||
virtual void *data() = 0;
|
virtual void *data() = 0;
|
||||||
virtual const void *data() const = 0;
|
virtual const void *data() const = 0;
|
||||||
|
|
||||||
|
virtual size_t size() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ class BlobStore {
|
|||||||
public:
|
public:
|
||||||
virtual ~BlobStore() {}
|
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;
|
virtual std::unique_ptr<Blob> load(const std::string &key) = 0;
|
||||||
//TODO Needed for performance? Or is deleting loaded blobs enough?
|
//TODO Needed for performance? Or is deleting loaded blobs enough?
|
||||||
//virtual void remove(const std::string &key) = 0;
|
//virtual void remove(const std::string &key) = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user