Allow Blob::flush
This commit is contained in:
parent
628f4edec0
commit
e3f7b47440
@ -68,6 +68,10 @@ void BlobOnBlocks::write(const void *source, uint64_t offset, uint64_t size) {
|
||||
});
|
||||
}
|
||||
|
||||
void BlobOnBlocks::flush() {
|
||||
_datatree->flush();
|
||||
}
|
||||
|
||||
void BlobOnBlocks::resizeIfSmallerThan(uint64_t neededSize) {
|
||||
//TODO This is inefficient, because size() and resizeNumBytes() both traverse the tree. Better: _datatree->ensureMinSize(x)
|
||||
if (neededSize > size()) {
|
||||
|
@ -29,6 +29,8 @@ public:
|
||||
uint64_t tryRead(void *target, uint64_t offset, uint64_t size) const override;
|
||||
void write(const void *source, uint64_t offset, uint64_t size) override;
|
||||
|
||||
void flush() override;
|
||||
|
||||
std::unique_ptr<cachingdatatreestore::CachedDataTreeRef> releaseTree();
|
||||
|
||||
private:
|
||||
|
@ -36,6 +36,10 @@ public:
|
||||
uint64_t numStoredBytes() const {
|
||||
return _baseTree->numStoredBytes();
|
||||
}
|
||||
|
||||
void flush() {
|
||||
return _baseTree->flush();
|
||||
}
|
||||
private:
|
||||
datatreestore::DataTree *_baseTree;
|
||||
};
|
||||
|
@ -22,6 +22,8 @@ public:
|
||||
virtual uint64_t tryRead(void *target, uint64_t offset, uint64_t size) const = 0;
|
||||
virtual void write(const void *source, uint64_t offset, uint64_t size) = 0;
|
||||
|
||||
virtual void flush() = 0;
|
||||
|
||||
//TODO Test tryRead
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user