Add Blob::key()

This commit is contained in:
Sebastian Messmer 2015-02-27 00:18:26 +01:00
parent 0e17ea5b29
commit 8dd0275c75
3 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,7 @@ using std::unique_ptr;
using std::function; using std::function;
using blobstore::onblocks::datanodestore::DataLeafNode; using blobstore::onblocks::datanodestore::DataLeafNode;
using blobstore::onblocks::datanodestore::DataNodeLayout; using blobstore::onblocks::datanodestore::DataNodeLayout;
using blockstore::Key;
namespace blobstore { namespace blobstore {
namespace onblocks { namespace onblocks {
@ -59,5 +60,9 @@ void BlobOnBlocks::write(const void *source, uint64_t offset, uint64_t size) {
}); });
} }
Key BlobOnBlocks::key() const {
return _datatree->key();
}
} }
} }

View File

@ -20,6 +20,8 @@ public:
BlobOnBlocks(std::unique_ptr<datatreestore::DataTree> datatree); BlobOnBlocks(std::unique_ptr<datatreestore::DataTree> datatree);
virtual ~BlobOnBlocks(); virtual ~BlobOnBlocks();
blockstore::Key key() const override;
uint64_t size() const override; uint64_t size() const override;
void resize(uint64_t numBytes) override; void resize(uint64_t numBytes) override;

View File

@ -5,12 +5,19 @@
#include <cstring> #include <cstring>
#include <cstdint> #include <cstdint>
namespace blockstore {
class Key;
}
namespace blobstore { namespace blobstore {
class Blob { class Blob {
public: public:
virtual ~Blob() {} virtual ~Blob() {}
//TODO Use own Key class for blobstore
virtual blockstore::Key key() const = 0;
virtual uint64_t size() const = 0; virtual uint64_t size() const = 0;
virtual void resize(uint64_t numBytes) = 0; virtual void resize(uint64_t numBytes) = 0;