Loading...
Searching...
No Matches
q3::NamedFactory< Product > Class Template Reference

A registry entry that builds one implementation of Product. More...

#include <named_factory.hpp>

Public Types

using Builder = std::function< std::unique_ptr< Product >()>
 

Public Member Functions

 NamedFactory (std::vector< std::string > names, Builder builder)
 An entry answering to names (the first is canonical) that builds with builder.
 
std::unique_ptr< Product > create () const
 A newly built implementation.
 
const std::vector< std::string > & names () const
 The names this entry answers to; the first is canonical.
 

Detailed Description

template<typename Product>
class q3::NamedFactory< Product >

A registry entry that builds one implementation of Product.

Definition at line 21 of file named_factory.hpp.

Member Typedef Documentation

◆ Builder

template<typename Product >
using q3::NamedFactory< Product >::Builder = std::function<std::unique_ptr<Product>()>

Definition at line 23 of file named_factory.hpp.

Constructor & Destructor Documentation

◆ NamedFactory()

template<typename Product >
q3::NamedFactory< Product >::NamedFactory ( std::vector< std::string >  names,
Builder  builder 
)
inline

An entry answering to names (the first is canonical) that builds with builder.

Definition at line 26 of file named_factory.hpp.

Member Function Documentation

◆ create()

template<typename Product >
std::unique_ptr< Product > q3::NamedFactory< Product >::create ( ) const
inline

A newly built implementation.

Definition at line 35 of file named_factory.hpp.

◆ names()

template<typename Product >
const std::vector< std::string > & q3::NamedFactory< Product >::names ( ) const
inline

The names this entry answers to; the first is canonical.

Definition at line 30 of file named_factory.hpp.


The documentation for this class was generated from the following file: