diff options
author | Pierre Bourdon <delroth@gmail.com> | 2024-06-05 06:02:18 +0200 |
---|---|---|
committer | Rebecca Turner <rbt@sent.as> | 2024-08-26 16:27:31 -0700 |
commit | 4f02255c205378427f5831463c0c07e45382b2b2 (patch) | |
tree | 875efcf49a86ced24b37d72587bc4dfb153c4460 /src/libstore/store-api.hh | |
parent | ca08f1217d8779971d4f2b306a19ad5622360372 (diff) |
libstore: remove static initializers for Store registrations
Ref #359.
Change-Id: Ia45530ddee25fa9fc399ff10738bb0d8bbc8b221
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r-- | src/libstore/store-api.hh | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index efd0e4d9b..2da5cac39 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -50,11 +50,9 @@ namespace nix { * that calls `StoreConfig(params)` (otherwise you're gonna encounter an * `assertion failure` when trying to instantiate it). * - * You can then register the new store using: - * - * ``` - * cpp static RegisterStoreImplementation<Foo, FooConfig> regStore; - * ``` + * You can then register the new store by defining a registration function + * (using `StoreImplementations::add`) and calling it in + * `registerStoreImplementations` in `globals.cc`. */ MakeError(SubstError, Error); @@ -1004,7 +1002,7 @@ struct StoreFactory std::function<std::shared_ptr<StoreConfig> ()> getConfig; }; -struct Implementations +struct StoreImplementations { static std::vector<StoreFactory> * registered; @@ -1027,15 +1025,6 @@ struct Implementations } }; -template<typename T, typename TConfig> -struct RegisterStoreImplementation -{ - RegisterStoreImplementation() - { - Implementations::add<T, TConfig>(); - } -}; - /** * Display a set of paths in human-readable form (i.e., between quotes |