2015-04-09 15:40:27 +02:00
|
|
|
#pragma once
|
|
|
|
#ifndef BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_CACHINGDATATREESTORE_CACHINGDATATREESTORE_H_
|
|
|
|
#define BLOBSTORE_IMPLEMENTATIONS_ONBLOCKS_CACHINGDATATREESTORE_CACHINGDATATREESTORE_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <messmer/cpp-utils/macros.h>
|
|
|
|
#include <messmer/cachingstore/CachingStore.h>
|
2015-04-09 20:07:21 +02:00
|
|
|
#include <messmer/blockstore/utils/Key.h>
|
2015-04-09 15:40:27 +02:00
|
|
|
|
|
|
|
namespace blobstore {
|
|
|
|
namespace onblocks {
|
|
|
|
namespace datatreestore {
|
|
|
|
class DataTreeStore;
|
|
|
|
class DataTree;
|
|
|
|
}
|
|
|
|
namespace cachingdatatreestore {
|
|
|
|
class CachedDataTreeRef;
|
|
|
|
|
2015-04-09 18:45:25 +02:00
|
|
|
//TODO Test CachingDataTreeStore
|
|
|
|
|
2015-04-09 15:40:27 +02:00
|
|
|
class CachingDataTreeStore {
|
|
|
|
public:
|
|
|
|
CachingDataTreeStore(std::unique_ptr<datatreestore::DataTreeStore> dataTreeStore);
|
|
|
|
virtual ~CachingDataTreeStore();
|
|
|
|
|
|
|
|
std::unique_ptr<CachedDataTreeRef> load(const blockstore::Key &key);
|
|
|
|
|
|
|
|
std::unique_ptr<CachedDataTreeRef> createNewTree();
|
|
|
|
|
|
|
|
void remove(std::unique_ptr<CachedDataTreeRef> tree);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<datatreestore::DataTreeStore> _dataTreeStore;
|
|
|
|
cachingstore::CachingStore<datatreestore::DataTree, CachedDataTreeRef, blockstore::Key> _cachingStore;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CachingDataTreeStore);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|