\doxysection{gko::\+Enable\+Default\+Factory\texorpdfstring{$<$}{<} Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1EnableDefaultFactory}{}\label{classgko_1_1EnableDefaultFactory}\index{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}}


This mixin provides a default implementation of a concrete factory.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+base/\+abstract\+\_\+factory.\+hpp$>$}



Inheritance diagram for gko::\+Enable\+Default\+Factory\texorpdfstring{$<$}{<} Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1EnableDefaultFactory__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+Enable\+Default\+Factory\texorpdfstring{$<$}{<} Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1EnableDefaultFactory__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1EnableDefaultFactory_ac762510ed96961493c273338ca358ecf}\label{classgko_1_1EnableDefaultFactory_ac762510ed96961493c273338ca358ecf} 
using {\bfseries product\+\_\+type} = Product\+Type
\item 
\Hypertarget{classgko_1_1EnableDefaultFactory_a911e420cd7f7c7f5550abbf0e788b59a}\label{classgko_1_1EnableDefaultFactory_a911e420cd7f7c7f5550abbf0e788b59a} 
using {\bfseries parameters\+\_\+type} = Parameters\+Type
\item 
\Hypertarget{classgko_1_1EnableDefaultFactory_a76344d95116ad7c95190152ecd64c2fb}\label{classgko_1_1EnableDefaultFactory_a76344d95116ad7c95190152ecd64c2fb} 
using {\bfseries polymorphic\+\_\+base} = Polymorphic\+Base
\item 
using \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory_ad35b6012e82e4f27a336a29fa7453cd6}{abstract\+\_\+product\+\_\+type}}
\item 
\Hypertarget{classgko_1_1EnableDefaultFactory_a5006a049ebb2f4d5c0f274f9d82ce870}\label{classgko_1_1EnableDefaultFactory_a5006a049ebb2f4d5c0f274f9d82ce870} 
using {\bfseries components\+\_\+type} = typename Polymorphic\+Base::\+components\+\_\+type
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Concrete\+Factory $>$}}}
\begin{DoxyCompactItemize}
\item 
using {\bfseries result\+\_\+type}
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1EnableDefaultFactory_a19cd0425db0ad9a1ea1d7229ef9c8f55}\label{classgko_1_1EnableDefaultFactory_a19cd0425db0ad9a1ea1d7229ef9c8f55} 
{\footnotesize template$<$typename... Args$>$ }\\std::\+unique\+\_\+ptr$<$ product\+\_\+type $>$ {\bfseries generate} (Args \&\&... args) const
\item 
const parameters\+\_\+type \& \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory_aea318b407943e1773d2374d314130d22}{get\+\_\+parameters}} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the parameters of the factory. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{gko::\+\+Enable\+Polymorphic\+Assignment$<$ Concrete\+Factory $>$}}}
\begin{DoxyCompactItemize}
\item 
void {\bfseries convert\+\_\+to} (result\+\_\+type \texorpdfstring{$\ast$}{*}result) const override
\item 
void {\bfseries move\+\_\+to} (result\+\_\+type \texorpdfstring{$\ast$}{*}result) override
\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static parameters\+\_\+type \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory_a1d077101d9e788e6c65f088612d14cc3}{create}} ()
\begin{DoxyCompactList}\small\item\em Creates a new Parameters\+Type object which can be used to instantiate a new Concrete\+Factory. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1EnableDefaultFactory_a01a6ad051cccd6915df38622922a5bb6}\label{classgko_1_1EnableDefaultFactory_a01a6ad051cccd6915df38622922a5bb6} 
class {\bfseries Enable\+Polymorphic\+Object$<$ Concrete\+Factory, Polymorphic\+Base $>$}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Concrete\+Factory, typename Product\+Type, typename Parameters\+Type, typename Polymorphic\+Base$>$\newline
class gko::\+\+Enable\+Default\+Factory$<$ Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base $>$}
This mixin provides a default implementation of a concrete factory. 

It implements all the methods of \doxylink{classgko_1_1AbstractFactory}{Abstract\+Factory} and \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object}. Its implementation of the generate\+\_\+impl() method delegates the creation of the product by calling the {\ttfamily Product\+Type::\+\+Product\+Type(const Concrete\+Factory \texorpdfstring{$\ast$}{*}, const components\+\_\+type \&)} constructor. The factory also supports parameters by using the {\ttfamily Parameters\+Type} structure, which is defined by the user.

For a simple example, see Int\+Factory in {\ttfamily core/\+test/\+base/\+abstract\+\_\+factory.\+cpp}.


\begin{DoxyTemplParams}{Template Parameters}
{\em Concrete\+Factory} & the concrete factory which is being implemented \+[CRTP parameter]\+ \\
\hline
{\em Product\+Type} & the concrete type of products which this factory produces, has to be a subclass of Polymorphic\+Base::\+abstract\+\_\+product\+\_\+type \\
\hline
{\em Parameters\+Type} & a type representing the parameters of the factory, has to inherit from the \doxylink{classgko_1_1enable__parameters__type}{enable\+\_\+parameters\+\_\+type} mixin \\
\hline
{\em Polymorphic\+Base} & parent of Concrete\+Factory in the polymorphic hierarchy, has to be a subclass of \doxylink{classgko_1_1AbstractFactory}{Abstract\+Factory} \\
\hline
\end{DoxyTemplParams}


\label{doc-typedef-members}
\Hypertarget{classgko_1_1EnableDefaultFactory_doc-typedef-members}
\doxysubsection{Member Typedef Documentation}
\Hypertarget{classgko_1_1EnableDefaultFactory_ad35b6012e82e4f27a336a29fa7453cd6}\index{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}!abstract\_product\_type@{abstract\_product\_type}}
\index{abstract\_product\_type@{abstract\_product\_type}!gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}}
\doxysubsubsection{\texorpdfstring{abstract\_product\_type}{abstract\_product\_type}}
{\footnotesize\ttfamily \label{classgko_1_1EnableDefaultFactory_ad35b6012e82e4f27a336a29fa7453cd6} 
template$<$typename Concrete\+Factory, typename Product\+Type, typename Parameters\+Type, typename Polymorphic\+Base$>$ \\
using \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory}{gko::\+\+Enable\+Default\+Factory}}$<$ Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base $>$::\+abstract\+\_\+product\+\_\+type}

{\bfseries Initial value:\+}
\begin{DoxyCode}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{typename}\ PolymorphicBase::abstract\_product\_type}

\end{DoxyCode}


\label{doc-func-members}
\Hypertarget{classgko_1_1EnableDefaultFactory_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1EnableDefaultFactory_a1d077101d9e788e6c65f088612d14cc3}\index{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}!create@{create}}
\index{create@{create}!gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}}
\doxysubsubsection{\texorpdfstring{create()}{create()}}
{\footnotesize\ttfamily \label{classgko_1_1EnableDefaultFactory_a1d077101d9e788e6c65f088612d14cc3} 
template$<$typename Concrete\+Factory, typename Product\+Type, typename Parameters\+Type, typename Polymorphic\+Base$>$ \\
parameters\+\_\+type \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory}{gko::\+\+Enable\+Default\+Factory}}$<$ Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base $>$::\+create (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Creates a new Parameters\+Type object which can be used to instantiate a new Concrete\+Factory. 

This method does not construct the factory directly, but returns a new parameters\+\_\+type object, which can be used to set the parameters of the factory. Once the parameters have been set, the parameters\+\_\+type::\+on() method can be used to obtain an instance of the factory with those parameters.

\begin{DoxyReturn}{Returns}
a default parameters\+\_\+type object 
\end{DoxyReturn}
\Hypertarget{classgko_1_1EnableDefaultFactory_aea318b407943e1773d2374d314130d22}\index{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}!get\_parameters@{get\_parameters}}
\index{get\_parameters@{get\_parameters}!gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$@{gko::EnableDefaultFactory$<$ ConcreteFactory, ProductType, ParametersType, PolymorphicBase $>$}}
\doxysubsubsection{\texorpdfstring{get\_parameters()}{get\_parameters()}}
{\footnotesize\ttfamily \label{classgko_1_1EnableDefaultFactory_aea318b407943e1773d2374d314130d22} 
template$<$typename Concrete\+Factory, typename Product\+Type, typename Parameters\+Type, typename Polymorphic\+Base$>$ \\
const parameters\+\_\+type \& \doxymbox{\hyperlink{classgko_1_1EnableDefaultFactory}{gko::\+\+Enable\+Default\+Factory}}$<$ Concrete\+Factory, Product\+Type, Parameters\+Type, Polymorphic\+Base $>$::\+get\+\_\+parameters (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the parameters of the factory. 

\begin{DoxyReturn}{Returns}
the parameters of the factory 
\end{DoxyReturn}


The documentation for this class was generated from the following file:\+\begin{DoxyCompactItemize}
\item 
ginkgo/\+core/\+base/\+abstract\+\_\+factory.\+hpp\end{DoxyCompactItemize}
