diff options
Diffstat (limited to 'src/libexpr/flake/eval-cache.hh')
-rw-r--r-- | src/libexpr/flake/eval-cache.hh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libexpr/flake/eval-cache.hh b/src/libexpr/flake/eval-cache.hh new file mode 100644 index 000000000..f81d48ba5 --- /dev/null +++ b/src/libexpr/flake/eval-cache.hh @@ -0,0 +1,40 @@ +#pragma once + +#include "sync.hh" +#include "flake.hh" +#include "path.hh" + +namespace nix { struct SQLite; struct SQLiteStmt; } + +namespace nix::flake { + +class EvalCache +{ + struct State; + + std::unique_ptr<Sync<State>> _state; + + EvalCache(); + +public: + + struct Derivation + { + StorePath drvPath; + StorePath outPath; + std::string outputName; + }; + + void addDerivation( + const Fingerprint & fingerprint, + const std::string & attrPath, + const Derivation & drv); + + std::optional<Derivation> getDerivation( + const Fingerprint & fingerprint, + const std::string & attrPath); + + static EvalCache & singleton(); +}; + +} |