sapling/eden/fs/store/BackingStore.h
Wez Furlong 0a6aa21d77 eden: fix multiply defined symbols issue with ImportPriority
Summary:
This is a rough pass that resolves a linker issue on MSVC by
switching to inline static member functions.

Reviewed By: chadaustin

Differential Revision: D20529163

fbshipit-source-id: 578ed440758c685091d3e039e261638e027db17a
2020-03-20 10:56:08 -07:00

67 lines
1.6 KiB
C++

/*
* 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 <folly/futures/Future.h>
#include <memory>
#include "eden/fs/store/ImportPriority.h"
namespace folly {
template <typename T>
class Future;
}
namespace facebook {
namespace eden {
class Blob;
class Hash;
class Tree;
/**
* Abstract interface for a BackingStore.
*
* A BackingStore fetches tree and blob information from an external
* authoritative data source.
*
* BackingStore implementations must be thread-safe, and perform their own
* internal locking.
*/
class BackingStore {
public:
BackingStore() {}
virtual ~BackingStore() {}
virtual folly::SemiFuture<std::unique_ptr<Tree>> getTree(
const Hash& id,
ImportPriority priority = ImportPriority::kNormal()) = 0;
virtual folly::SemiFuture<std::unique_ptr<Blob>> getBlob(
const Hash& id,
ImportPriority priority = ImportPriority::kNormal()) = 0;
virtual folly::SemiFuture<std::unique_ptr<Tree>> getTreeForCommit(
const Hash& commitID) = 0;
virtual folly::SemiFuture<std::unique_ptr<Tree>> getTreeForManifest(
const Hash& commitID,
const Hash& manifestID) = 0;
FOLLY_NODISCARD virtual folly::Future<folly::Unit> prefetchBlobs(
const std::vector<Hash>& /*ids*/) const {
return folly::unit;
}
virtual void periodicManagementTask() {}
private:
// Forbidden copy constructor and assignment operator
BackingStore(BackingStore const&) = delete;
BackingStore& operator=(BackingStore const&) = delete;
};
} // namespace eden
} // namespace facebook