\doxysection{gko::\+Enable\+Polymorphic\+Object\texorpdfstring{$<$}{<} Concrete\+Object, Polymorphic\+Base \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classgko_1_1EnablePolymorphicObject}{}\label{classgko_1_1EnablePolymorphicObject}\index{gko::EnablePolymorphicObject$<$ ConcreteObject, PolymorphicBase $>$@{gko::EnablePolymorphicObject$<$ ConcreteObject, PolymorphicBase $>$}}


This mixin inherits from (a subclass of) \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object} and provides a base implementation of a new concrete polymorphic object.  




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



Inherits Enable\+Abstract\+Polymorphic\+Object$<$ Concrete\+Object, Polymorphic\+Object $>$.



Inherited by \doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1Partition}{gko::\+experimental::\+distributed::\+\+Partition$<$ Local\+Index\+Type, Global\+Index\+Type $>$}}.



Collaboration diagram for gko::\+Enable\+Polymorphic\+Object\texorpdfstring{$<$}{<} Concrete\+Object, Polymorphic\+Base \texorpdfstring{$>$}{>}:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=265pt]{classgko_1_1EnablePolymorphicObject__coll__graph}
\end{center}
\end{figure}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Concrete\+Object, typename Polymorphic\+Base = Polymorphic\+Object$>$\newline
class gko::\+\+Enable\+Polymorphic\+Object$<$ Concrete\+Object, Polymorphic\+Base $>$}
This mixin inherits from (a subclass of) \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object} and provides a base implementation of a new concrete polymorphic object. 

The mixin changes parameter and return types of appropriate public methods of \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object} in the same way Enable\+Abstract\+Polymorphic\+Object does. In addition, it also provides default implementations of \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object}\textquotesingle{}s virtual methods by using the {\itshape executor default constructor} and the assignment operator of Concrete\+Object. Consequently, the following is a minimal example of \doxylink{classgko_1_1PolymorphicObject}{Polymorphic\+Object}:\+


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{struct\ }MyObject\ :\ EnablePolymorphicObject<MyObject>\ \{}
\DoxyCodeLine{\ \ \ \ MyObject(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ :\ EnablePolymorphicObject<MyObject>(std::move(exec))}
\DoxyCodeLine{\ \ \ \ \{\}}
\DoxyCodeLine{\};}

\end{DoxyCode}


In a way, this mixin can be viewed as an extension of default constructor/\+destructor/\+assignment operators.

\begin{DoxyNote}{Note}
This mixin does not enable copying the polymorphic object to the object of the same type (i.\+e. it does not implement the Convertible\+To$<$\+Concrete\+Object$>$ interface). To enable a default implementation of this interface see the \doxylink{classgko_1_1EnablePolymorphicAssignment}{Enable\+Polymorphic\+Assignment} mixin.
\end{DoxyNote}

\begin{DoxyTemplParams}{Template Parameters}
{\em Concrete\+Object} & the concrete type which is being implemented \+[CRTP parameter]\+ \\
\hline
{\em Polymorphic\+Base} & parent of Concrete\+Object in the polymorphic hierarchy, has to be a subclass of polymorphic object \\
\hline
\end{DoxyTemplParams}


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