sapling/eden/fs/store/EmptyBackingStore.h

41 lines
1.1 KiB
C
Raw Normal View History

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include "BackingStore.h"
#include "eden/fs/store/ObjectFetchContext.h"
namespace facebook {
namespace eden {
/*
* A dummy BackingStore implementation, that always throws std::domain_error
* for any ID that is looked up.
*/
class EmptyBackingStore : public BackingStore {
public:
EmptyBackingStore();
~EmptyBackingStore() override;
folly::SemiFuture<std::unique_ptr<Tree>> getTree(
const Hash& id,
ObjectFetchContext& context) override;
folly::SemiFuture<std::unique_ptr<Blob>> getBlob(
const Hash& id,
ObjectFetchContext& context) override;
folly::SemiFuture<std::unique_ptr<Tree>> getTreeForCommit(
const Hash& commitID,
ObjectFetchContext& context) override;
folly::SemiFuture<std::unique_ptr<Tree>> getTreeForManifest(
const Hash& commitID,
const Hash& manifestID,
ObjectFetchContext& context) override;
};
} // namespace eden
} // namespace facebook