Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
pseudopotential_format_registry.hpp
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* The pseudopotential file formats this build can read.
5
*
6
* Core seeds the registry with UPF on first use. A build-time add-on registers
7
* its formats from its registration function, which every entry point runs
8
* before it reads input (io/addon_registration.hpp). Formats are consulted in
9
* registration order, so core's UPF is always asked first.
10
*/
11
12
#include <memory>
13
14
#include "
io/pseudopotential/pseudopotential_format.hpp
"
15
#include "
io/pseudopotential/upf_pseudopotential_format.hpp
"
16
#include "
utils/registry.hpp
"
17
18
namespace
q3
{
19
20
/// The registry PseudopotentialFactory::read() chooses a format from.
21
inline
Registry<PseudopotentialFormat>
&
pseudopotential_format_registry
() {
22
static
Registry<PseudopotentialFormat>
registry = [] {
23
Registry<PseudopotentialFormat>
seeded;
24
seeded.
add
(std::make_unique<UPFPseudopotentialFormat>());
25
return
seeded;
26
}();
27
return
registry;
28
}
29
30
}
// namespace q3
q3::Registry
An ordered set of interchangeable implementations of Entry, found by name.
Definition
registry.hpp:33
q3::Registry::add
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
q3
Definition
q3_core_api.hpp:33
q3::pseudopotential_format_registry
Registry< PseudopotentialFormat > & pseudopotential_format_registry()
The registry PseudopotentialFactory::read() chooses a format from.
Definition
pseudopotential_format_registry.hpp:21
pseudopotential_format.hpp
upf_pseudopotential_format.hpp
registry.hpp
src
io
pseudopotential
pseudopotential_format_registry.hpp
Generated by
1.9.8