diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 08:39:24 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 08:39:24 +0100 |
commit | 20d7b93b0c83db3d620009e440263d7ab8faeec6 (patch) | |
tree | f932ebaf085114a1377f6f14ec3c305199fb8c74 /src/libstore/machines.hh | |
parent | fad1a25e17350e67fc9857ba6ec80ac829efd2ed (diff) |
Merge pull request #9838 from obsidiansystems/systemTypes-set
Make `Machine::systemTypes` a set not vector
(cherry picked from commit f1b030415376e81c5804647c055d71eaba4aa725)
Change-Id: I6d4f5c0bfc226e9bd66c58c360cd99e3fac9a129
Diffstat (limited to 'src/libstore/machines.hh')
-rw-r--r-- | src/libstore/machines.hh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libstore/machines.hh b/src/libstore/machines.hh index 1adeaf1f0..1bca74c28 100644 --- a/src/libstore/machines.hh +++ b/src/libstore/machines.hh @@ -10,7 +10,7 @@ class Store; struct Machine { const std::string storeUri; - const std::vector<std::string> systemTypes; + const std::set<std::string> systemTypes; const std::string sshKey; const unsigned int maxJobs; const unsigned int speedFactor; @@ -19,8 +19,21 @@ struct Machine { const std::string sshPublicHostKey; bool enabled = true; + /** + * @return Whether `system` is either `"builtin"` or in + * `systemTypes`. + */ + bool systemSupported(const std::string & system) const; + + /** + * @return Whether `features` is a subset of the union of `supportedFeatures` and + * `mandatoryFeatures` + */ bool allSupported(const std::set<std::string> & features) const; + /** + * @return @Whether `mandatoryFeatures` is a subset of `features` + */ bool mandatoryMet(const std::set<std::string> & features) const; Machine(decltype(storeUri) storeUri, |