diff options
author | regnat <rg@regnat.ovh> | 2020-09-10 10:55:51 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2020-09-16 13:53:08 +0200 |
commit | 22afa8fb4dd7e459faf531dd8a9c3580d02c7e2a (patch) | |
tree | 00b6b6e1eaaccb3a190ce5d558298d8c9b013692 /src/libstore/dummy-store.cc | |
parent | aa4eac37881258797c241113a5602913e1a5371a (diff) |
Separate store configs from the implems
Rework the `Store` hierarchy so that there's now one hierarchy for the
store configs and one for the implementations (where each implementation
extends the corresponding config). So a class hierarchy like
```
StoreConfig-------->Store
| |
v v
SubStoreConfig----->SubStore
| |
v v
SubSubStoreConfig-->SubSubStore
```
(with virtual inheritance to prevent DDD).
The advantage of this architecture is that we can now introspect the configuration of a store without having to instantiate the store itself
Diffstat (limited to 'src/libstore/dummy-store.cc')
-rw-r--r-- | src/libstore/dummy-store.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/dummy-store.cc b/src/libstore/dummy-store.cc index 52086445e..d4560c13d 100644 --- a/src/libstore/dummy-store.cc +++ b/src/libstore/dummy-store.cc @@ -2,6 +2,8 @@ namespace nix { +struct DummyStoreConfig : StoreConfig {}; + struct DummyStore : public Store { DummyStore(const std::string uri, const Params & params) @@ -54,6 +56,6 @@ struct DummyStore : public Store { unsupported("buildDerivation"); } }; -static RegisterStoreImplementation<DummyStore> regStore; +static RegisterStoreImplementation<DummyStore, DummyStoreConfig> regStore; } |