tvl-depot/third_party/nix/src/libstore/nar-info-disk-cache.hh
Vincent Ambo 15afa8472e fix(3p/nix): Fix all remaining compiler warnings
This compiles under `-Wall -Werror`.

The largest chunk of this change is `final` qualifiers for the various
Nix CLI command structs, which inherit from a Command class that has
more virtual functions than are implemented by each command.

Change-Id: I0925e6e1a39013f026773db5816e4a77d50f3b4a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1294
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-19 22:00:59 +00:00

30 lines
931 B
C++

#pragma once
#include "libstore/nar-info.hh"
#include "libutil/ref.hh"
namespace nix {
class NarInfoDiskCache {
public:
typedef enum { oValid, oInvalid, oUnknown } Outcome;
virtual void createCache(const std::string& uri, const Path& storeDir,
bool wantMassQuery, int priority) = 0;
virtual bool cacheExists(const std::string& uri, bool& wantMassQuery,
int& priority) = 0;
virtual std::pair<Outcome, std::shared_ptr<NarInfo>> lookupNarInfo(
const std::string& uri, const std::string& hashPart) = 0;
virtual void upsertNarInfo(const std::string& uri,
const std::string& hashPart,
std::shared_ptr<ValidPathInfo> info) = 0;
};
/* Return a singleton cache object that can be used concurrently by
multiple threads. */
std::shared_ptr<NarInfoDiskCache> getNarInfoDiskCache();
} // namespace nix