Loading...
Searching...
No Matches
registry.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * The PAW one-center conventions this build can compute in.
5 *
6 * Keyed by the name a dataset records in PawPseudopotential::one_center_convention.
7 * Core seeds the registry with "absolute", QE's convention and the one UPF-PAW
8 * datasets follow. A build-time add-on that reads datasets generated for
9 * another convention registers that convention from its registration function,
10 * which every entry point runs before it reads input (io/addon_registration.hpp).
11 */
12
13#include <memory>
14#include <string>
15#include <vector>
16
19#include "utils/registry.hpp"
20
21namespace q3 {
22namespace paw_one_center {
23
24/// The registry create_one_center_convention() builds conventions from.
28 seeded.add(std::make_unique<NamedFactory<PawOneCenterConvention>>(
29 std::vector<std::string>{"absolute"},
30 [] { return std::make_unique<PawOneCenterConvention>(); }));
31 return seeded;
32 }();
33 return registry;
34}
35
36} // namespace paw_one_center
37} // namespace q3
A registry entry that builds one implementation of Product.
An ordered set of interchangeable implementations of Entry, found by name.
Definition registry.hpp:33
void add(std::unique_ptr< Entry > entry)
Add entry; throws std::logic_error when one of its names is already registered.
Definition registry.hpp:36
Registry< NamedFactory< PawOneCenterConvention > > & one_center_convention_registry()
The registry create_one_center_convention() builds conventions from.
Definition registry.hpp:25