23 using Builder = std::function<std::unique_ptr<Product>()>;
27 : names_(std::move(
names)), builder_(std::move(builder)) {}
30 [[nodiscard]]
const std::vector<std::string>&
names()
const {
35 [[nodiscard]] std::unique_ptr<Product>
create()
const {
40 std::vector<std::string> names_;
A registry entry that builds one implementation of Product.
std::function< std::unique_ptr< Product >()> Builder
std::unique_ptr< Product > create() const
A newly built implementation.
NamedFactory(std::vector< std::string > names, Builder builder)
An entry answering to names (the first is canonical) that builds with builder.
const std::vector< std::string > & names() const
The names this entry answers to; the first is canonical.