\doxysection{polymorphic\+\_\+object.\+hpp}
\hypertarget{polymorphic__object_8hpp_source}{}\label{polymorphic__object_8hpp_source}\index{ginkgo/core/base/polymorphic\_object.hpp@{ginkgo/core/base/polymorphic\_object.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2024\ The\ Ginkgo\ authors}}
\DoxyCodeLine{00002\ \textcolor{comment}{//}}
\DoxyCodeLine{00003\ \textcolor{comment}{//\ SPDX-\/License-\/Identifier:\ BSD-\/3-\/Clause}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ GKO\_PUBLIC\_CORE\_BASE\_POLYMORPHIC\_OBJECT\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_BASE\_POLYMORPHIC\_OBJECT\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <type\_traits>}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/executor.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/utils.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/log/logger.hpp>}}
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00018\ \textcolor{keyword}{namespace\ }experimental\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1experimental_1_1distributed}{distributed}}\ \{}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1DistributedBase}{DistributedBase}};}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \}\ \ \textcolor{comment}{//\ namespace\ distributed}}
\DoxyCodeLine{00026\ \}\ \ \textcolor{comment}{//\ namespace\ experimental}}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00052\ \textcolor{keyword}{class\ }PolymorphicObject\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1log_1_1EnableLogging}{log::EnableLogging}}<PolymorphicObject>\ \{}
\DoxyCodeLine{00053\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keyword}{virtual}\ \string~PolymorphicObject()}
\DoxyCodeLine{00055\ \ \ \ \ \{}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_deleted>(exec\_.get(),}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{this});}
\DoxyCodeLine{00058\ \ \ \ \ \}}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{comment}{//\ preserve\ the\ executor\ of\ the\ object}}
\DoxyCodeLine{00061\ \ \ \ \ PolymorphicObject\&\ operator=(\textcolor{keyword}{const}\ PolymorphicObject\&)\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00073\ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_ab6860a65c4c0e53ad2ffc56487cfb78b}{create\_default}}(}
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00075\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_create\_started>(}
\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ \textcolor{keyword}{this});}
\DoxyCodeLine{00078\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ created\ =\ this-\/>create\_default\_impl(std::move(exec));}
\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_create\_completed>(}
\DoxyCodeLine{00080\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ \textcolor{keyword}{this},\ created.get());}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ created;}
\DoxyCodeLine{00082\ \ \ \ \ \}}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00092\ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a79a7e8ec664d4651df9125ce4653607b}{create\_default}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00093\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00094\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>\doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a79a7e8ec664d4651df9125ce4653607b}{create\_default}}(exec\_);}
\DoxyCodeLine{00095\ \ \ \ \ \}}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00107\ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_ad633faaf91de363fc2ba2c1a0e8d07ad}{clone}}(}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00109\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00110\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ new\_op\ =\ this-\/>\doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a79a7e8ec664d4651df9125ce4653607b}{create\_default}}(exec);}
\DoxyCodeLine{00111\ \ \ \ \ \ \ \ \ new\_op-\/>copy\_from(\textcolor{keyword}{this});}
\DoxyCodeLine{00112\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ new\_op;}
\DoxyCodeLine{00113\ \ \ \ \ \}}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00123\ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a892adf1d9fbc1e7c2e49a9be4d98de2c}{clone}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00124\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>\doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a892adf1d9fbc1e7c2e49a9be4d98de2c}{clone}}(exec\_);}
\DoxyCodeLine{00126\ \ \ \ \ \}}
\DoxyCodeLine{00127\ }
\DoxyCodeLine{00139\ \ \ \ \ PolymorphicObject*\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a3c431a34c3ad724e1337b73165f1da9b}{copy\_from}}(\textcolor{keyword}{const}\ PolymorphicObject*\ other)}
\DoxyCodeLine{00140\ \ \ \ \ \{}
\DoxyCodeLine{00141\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_copy\_started>(}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ other,\ \textcolor{keyword}{this});}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ copied\ =\ this-\/>copy\_from\_impl(other);}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_copy\_completed>(}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ other,\ \textcolor{keyword}{this});}
\DoxyCodeLine{00146\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ copied;}
\DoxyCodeLine{00147\ \ \ \ \ \}}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00164\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Derived,\ \textcolor{keyword}{typename}\ Deleter>}
\DoxyCodeLine{00165\ \ \ \ \ GKO\_DEPRECATED(}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}This\ function\ will\ be\ removed\ in\ a\ future\ release,\ the\ replacement\ "{}}}
\DoxyCodeLine{00167\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}will\ copy\ instead\ of\ move.\ If\ a\ move\ is\ intended,\ use\ move\_from\ "{}}}
\DoxyCodeLine{00168\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}instead."{}})}
\DoxyCodeLine{00169\ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::enable\_if\_t<}
\DoxyCodeLine{00170\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::is\_base\_of<\doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}},\ \doxymbox{\hyperlink{namespacestd}{std}}::decay\_t<Derived>>::value,}
\DoxyCodeLine{00171\ \ \ \ \ \ \ \ \ PolymorphicObject>*\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a3c431a34c3ad724e1337b73165f1da9b}{copy\_from}}(\doxymbox{\hyperlink{namespacestd}{std}}::unique\_ptr<Derived,\ Deleter>\&\&\ other)}
\DoxyCodeLine{00172\ \ \ \ \ \{}
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_move\_started>(}
\DoxyCodeLine{00174\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ other.get(),\ \textcolor{keyword}{this});}
\DoxyCodeLine{00175\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ copied\ =\ this-\/>copy\_from\_impl(std::move(other));}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_move\_completed>(}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ other.get(),\ \textcolor{keyword}{this});}
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ copied;}
\DoxyCodeLine{00179\ \ \ \ \ \}}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00188\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Derived,\ \textcolor{keyword}{typename}\ Deleter>}
\DoxyCodeLine{00189\ \ \ \ \ std::enable\_if\_t<}
\DoxyCodeLine{00190\ \ \ \ \ \ \ \ \ std::is\_base\_of<PolymorphicObject,\ std::decay\_t<Derived>>::value,}
\DoxyCodeLine{00191\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}>*}
\DoxyCodeLine{00192\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a5b3794e4e3e1a339e095436ac1c60fc8}{copy\_from}}(\textcolor{keyword}{const}\ std::unique\_ptr<Derived,\ Deleter>\&\ other)}
\DoxyCodeLine{00193\ \ \ \ \ \{}
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>\doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a3c431a34c3ad724e1337b73165f1da9b}{copy\_from}}(other.get());}
\DoxyCodeLine{00195\ \ \ \ \ \}}
\DoxyCodeLine{00196\ }
\DoxyCodeLine{00200\ \ \ \ \ PolymorphicObject*\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a49e1da638e13d055f105128f7040c1c7}{copy\_from}}(}
\DoxyCodeLine{00201\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::shared\_ptr<const\ PolymorphicObject>\&\ other)}
\DoxyCodeLine{00202\ \ \ \ \ \{}
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ this-\/>\doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a3c431a34c3ad724e1337b73165f1da9b}{copy\_from}}(other.get());}
\DoxyCodeLine{00204\ \ \ \ \ \}}
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00217\ \ \ \ \ PolymorphicObject*\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a6729df9a3d3ed70ec5565568f03847de}{move\_from}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<PolymorphicObject>}}\ other)}
\DoxyCodeLine{00218\ \ \ \ \ \{}
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_move\_started>(}
\DoxyCodeLine{00220\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ other.\doxymbox{\hyperlink{classgko_1_1ptr__param_ad1245c2636fdba26d3a3fab9fec5e068}{get}}(),\ \textcolor{keyword}{this});}
\DoxyCodeLine{00221\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ moved\ =\ this-\/>move\_from\_impl(other.\doxymbox{\hyperlink{classgko_1_1ptr__param_ad1245c2636fdba26d3a3fab9fec5e068}{get}}());}
\DoxyCodeLine{00222\ \ \ \ \ \ \ \ \ this-\/>\textcolor{keyword}{template}\ log<log::Logger::polymorphic\_object\_move\_completed>(}
\DoxyCodeLine{00223\ \ \ \ \ \ \ \ \ \ \ \ \ exec\_.get(),\ other.\doxymbox{\hyperlink{classgko_1_1ptr__param_ad1245c2636fdba26d3a3fab9fec5e068}{get}}(),\ \textcolor{keyword}{this});}
\DoxyCodeLine{00224\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ moved;}
\DoxyCodeLine{00225\ \ \ \ \ \}}
\DoxyCodeLine{00226\ }
\DoxyCodeLine{00236\ \ \ \ \ PolymorphicObject*\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_ad718977a6d5cf565a286f0247410cb11}{clear}}()\ \{\ \textcolor{keywordflow}{return}\ this-\/>clear\_impl();\ \}}
\DoxyCodeLine{00237\ }
\DoxyCodeLine{00243\ \ \ \ \ std::shared\_ptr<const\ Executor>\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject_a89f50e50860bb1ab04b1615b2447ad38}{get\_executor}}()\ const\ noexcept}
\DoxyCodeLine{00244\ \ \ \ \ \{}
\DoxyCodeLine{00245\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ exec\_;}
\DoxyCodeLine{00246\ \ \ \ \ \}}
\DoxyCodeLine{00247\ }
\DoxyCodeLine{00248\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00249\ \ \ \ \ \textcolor{comment}{//\ This\ method\ is\ defined\ as\ protected\ since\ a\ polymorphic\ object\ should\ not}}
\DoxyCodeLine{00250\ \ \ \ \ \textcolor{comment}{//\ be\ created\ using\ their\ constructor\ directly,\ but\ by\ creating\ an}}
\DoxyCodeLine{00251\ \ \ \ \ \textcolor{comment}{//\ std::unique\_ptr\ to\ it.\ Defining\ the\ constructor\ as\ protected\ keeps\ these}}
\DoxyCodeLine{00252\ \ \ \ \ \textcolor{comment}{//\ access\ rights\ when\ inheriting\ the\ constructor.}}
\DoxyCodeLine{00258\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{00259\ \ \ \ \ \ \ \ \ :\ exec\_\{\doxymbox{\hyperlink{namespacestd}{std}}::move(exec)\}}
\DoxyCodeLine{00260\ \ \ \ \ \{\}}
\DoxyCodeLine{00261\ }
\DoxyCodeLine{00262\ \ \ \ \ \textcolor{comment}{//\ preserve\ the\ executor\ of\ the\ object}}
\DoxyCodeLine{00263\ \ \ \ \ \textcolor{keyword}{explicit}\ PolymorphicObject(\textcolor{keyword}{const}\ PolymorphicObject\&\ other)}
\DoxyCodeLine{00264\ \ \ \ \ \{}
\DoxyCodeLine{00265\ \ \ \ \ \ \ \ \ *\textcolor{keyword}{this}\ =\ other;}
\DoxyCodeLine{00266\ \ \ \ \ \}}
\DoxyCodeLine{00267\ }
\DoxyCodeLine{00276\ \ \ \ \ \textcolor{keyword}{virtual}\ std::unique\_ptr<PolymorphicObject>\ create\_default\_impl(}
\DoxyCodeLine{00277\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec)\ \textcolor{keyword}{const}\ =\ 0;}
\DoxyCodeLine{00278\ }
\DoxyCodeLine{00287\ \ \ \ \ \textcolor{keyword}{virtual}\ PolymorphicObject*\ copy\_from\_impl(}
\DoxyCodeLine{00288\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ PolymorphicObject*\ other)\ =\ 0;}
\DoxyCodeLine{00289\ }
\DoxyCodeLine{00298\ \ \ \ \ \textcolor{keyword}{virtual}\ PolymorphicObject*\ copy\_from\_impl(}
\DoxyCodeLine{00299\ \ \ \ \ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ other)\ =\ 0;}
\DoxyCodeLine{00300\ }
\DoxyCodeLine{00309\ \ \ \ \ \textcolor{keyword}{virtual}\ PolymorphicObject*\ move\_from\_impl(PolymorphicObject*\ other)\ =\ 0;}
\DoxyCodeLine{00310\ }
\DoxyCodeLine{00319\ \ \ \ \ \textcolor{keyword}{virtual}\ PolymorphicObject*\ move\_from\_impl(}
\DoxyCodeLine{00320\ \ \ \ \ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ other)\ =\ 0;}
\DoxyCodeLine{00321\ }
\DoxyCodeLine{00328\ \ \ \ \ \textcolor{keyword}{virtual}\ PolymorphicObject*\ clear\_impl()\ =\ 0;}
\DoxyCodeLine{00329\ }
\DoxyCodeLine{00330\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00331\ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec\_;}
\DoxyCodeLine{00332\ \};}
\DoxyCodeLine{00333\ }
\DoxyCodeLine{00334\ }
\DoxyCodeLine{00353\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ AbstractObject,\ \textcolor{keyword}{typename}\ PolymorphicBase\ =\ PolymorphicObject>}
\DoxyCodeLine{00354\ \textcolor{keyword}{class\ }EnableAbstractPolymorphicObject\ :\ \textcolor{keyword}{public}\ PolymorphicBase\ \{}
\DoxyCodeLine{00355\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00356\ \ \ \ \ \textcolor{keyword}{using\ }PolymorphicBase::PolymorphicBase;}
\DoxyCodeLine{00357\ }
\DoxyCodeLine{00358\ \ \ \ \ std::unique\_ptr<AbstractObject>\ create\_default(}
\DoxyCodeLine{00359\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00360\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00361\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<AbstractObject>\{\textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00362\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::create\_default(std::move(exec)).release())\};}
\DoxyCodeLine{00363\ \ \ \ \ \}}
\DoxyCodeLine{00364\ }
\DoxyCodeLine{00365\ \ \ \ \ std::unique\_ptr<AbstractObject>\ create\_default()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00366\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00367\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<AbstractObject>\{\textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00368\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::create\_default().release())\};}
\DoxyCodeLine{00369\ \ \ \ \ \}}
\DoxyCodeLine{00370\ }
\DoxyCodeLine{00371\ \ \ \ \ std::unique\_ptr<AbstractObject>\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{clone}}(}
\DoxyCodeLine{00372\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00373\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00374\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<AbstractObject>\{\textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00375\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::clone(std::move(exec)).release())\};}
\DoxyCodeLine{00376\ \ \ \ \ \}}
\DoxyCodeLine{00377\ }
\DoxyCodeLine{00378\ \ \ \ \ std::unique\_ptr<AbstractObject>\ \doxymbox{\hyperlink{namespacegko_aa194e34282452493231ca7b01ffb5e64}{clone}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00379\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00380\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<AbstractObject>\{\textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00381\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::clone().release())\};}
\DoxyCodeLine{00382\ \ \ \ \ \}}
\DoxyCodeLine{00383\ }
\DoxyCodeLine{00384\ \ \ \ \ AbstractObject*\ copy\_from(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ other)}
\DoxyCodeLine{00385\ \ \ \ \ \{}
\DoxyCodeLine{00386\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00387\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::copy\_from(other));}
\DoxyCodeLine{00388\ \ \ \ \ \}}
\DoxyCodeLine{00389\ }
\DoxyCodeLine{00390\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Derived>}
\DoxyCodeLine{00391\ \ \ \ \ GKO\_DEPRECATED(}
\DoxyCodeLine{00392\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}This\ function\ will\ be\ removed\ in\ a\ future\ release,\ the\ replacement\ "{}}}
\DoxyCodeLine{00393\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}will\ copy\ instead\ of\ move.\ If\ a\ move\ in\ intended,\ use\ move\_to\ "{}}}
\DoxyCodeLine{00394\ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}instead."{}})}
\DoxyCodeLine{00395\ \ \ \ \ std::enable\_if\_t<}
\DoxyCodeLine{00396\ \ \ \ \ \ \ \ \ std::is\_base\_of<\doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}},\ std::decay\_t<Derived>>::value,}
\DoxyCodeLine{00397\ \ \ \ \ \ \ \ \ AbstractObject>*\ copy\_from(std::unique\_ptr<Derived>\&\&\ other)}
\DoxyCodeLine{00398\ \ \ \ \ \{}
\DoxyCodeLine{00399\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00400\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::copy\_from(std::move(other)));}
\DoxyCodeLine{00401\ \ \ \ \ \}}
\DoxyCodeLine{00402\ }
\DoxyCodeLine{00403\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ Derived>}
\DoxyCodeLine{00404\ \ \ \ \ std::enable\_if\_t<}
\DoxyCodeLine{00405\ \ \ \ \ \ \ \ \ std::is\_base\_of<PolymorphicObject,\ std::decay\_t<Derived>>::value,}
\DoxyCodeLine{00406\ \ \ \ \ \ \ \ \ AbstractObject>*}
\DoxyCodeLine{00407\ \ \ \ \ copy\_from(\textcolor{keyword}{const}\ std::unique\_ptr<Derived>\&\ other)}
\DoxyCodeLine{00408\ \ \ \ \ \{}
\DoxyCodeLine{00409\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ copy\_from(other.get());}
\DoxyCodeLine{00410\ \ \ \ \ \}}
\DoxyCodeLine{00411\ }
\DoxyCodeLine{00412\ \ \ \ \ AbstractObject*\ copy\_from(}
\DoxyCodeLine{00413\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::shared\_ptr<const\ PolymorphicObject>\&\ other)}
\DoxyCodeLine{00414\ \ \ \ \ \{}
\DoxyCodeLine{00415\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ copy\_from(other.get());}
\DoxyCodeLine{00416\ \ \ \ \ \}}
\DoxyCodeLine{00417\ }
\DoxyCodeLine{00418\ \ \ \ \ AbstractObject*\ move\_from(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<PolymorphicObject>}}\ other)}
\DoxyCodeLine{00419\ \ \ \ \ \{}
\DoxyCodeLine{00420\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(}
\DoxyCodeLine{00421\ \ \ \ \ \ \ \ \ \ \ \ \ this-\/>PolymorphicBase::move\_from(other.get()));}
\DoxyCodeLine{00422\ \ \ \ \ \}}
\DoxyCodeLine{00423\ }
\DoxyCodeLine{00424\ \ \ \ \ AbstractObject*\ clear()}
\DoxyCodeLine{00425\ \ \ \ \ \{}
\DoxyCodeLine{00426\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}AbstractObject*\textcolor{keyword}{>}(this-\/>PolymorphicBase::clear());}
\DoxyCodeLine{00427\ \ \ \ \ \}}
\DoxyCodeLine{00428\ \};}
\DoxyCodeLine{00429\ }
\DoxyCodeLine{00430\ }
\DoxyCodeLine{00439\ \textcolor{preprocessor}{\#define\ GKO\_ENABLE\_SELF(\_type)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00440\ \textcolor{preprocessor}{\ \ \ \ \_type*\ self()\ noexcept\ \{\ return\ static\_cast<\_type*>(this);\ \}\ \(\backslash\)}}
\DoxyCodeLine{00441\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00442\ \textcolor{preprocessor}{\ \ \ \ const\ \_type*\ self()\ const\ noexcept\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00443\ \textcolor{preprocessor}{\ \ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00444\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ return\ static\_cast<const\ \_type*>(this);\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00445\ \textcolor{preprocessor}{\ \ \ \ \}}}
\DoxyCodeLine{00446\ }
\DoxyCodeLine{00447\ }
\DoxyCodeLine{00478\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ResultType>}
\DoxyCodeLine{00479\ \textcolor{keyword}{class\ }ConvertibleTo\ \{}
\DoxyCodeLine{00480\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00481\ \ \ \ \ \textcolor{keyword}{using\ }result\_type\ =\ ResultType;}
\DoxyCodeLine{00482\ }
\DoxyCodeLine{00483\ \ \ \ \ \textcolor{keyword}{virtual}\ \string~ConvertibleTo()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00484\ }
\DoxyCodeLine{00490\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{namespacegko_a7cb327baf9ca9018d06fa5554464d29d}{convert\_to}}(result\_type*\ result)\ \textcolor{keyword}{const}\ =\ 0;}
\DoxyCodeLine{00491\ }
\DoxyCodeLine{00492\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{namespacegko_a7cb327baf9ca9018d06fa5554464d29d}{convert\_to}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<result\_type>}}\ result)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00493\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00494\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_a7cb327baf9ca9018d06fa5554464d29d}{convert\_to}}(result.\doxymbox{\hyperlink{classgko_1_1ptr__param_ad1245c2636fdba26d3a3fab9fec5e068}{get}}());}
\DoxyCodeLine{00495\ \ \ \ \ \}}
\DoxyCodeLine{00496\ }
\DoxyCodeLine{00511\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{namespacegko_a6fcc3453bf500454b56a5f2f196b871c}{move\_to}}(result\_type*\ result)\ =\ 0;}
\DoxyCodeLine{00512\ }
\DoxyCodeLine{00513\ \ \ \ \ \textcolor{keywordtype}{void}\ \doxymbox{\hyperlink{namespacegko_a6fcc3453bf500454b56a5f2f196b871c}{move\_to}}(\doxymbox{\hyperlink{classgko_1_1ptr__param}{ptr\_param<result\_type>}}\ result)\ \{\ \doxymbox{\hyperlink{namespacegko_a6fcc3453bf500454b56a5f2f196b871c}{move\_to}}(result.\doxymbox{\hyperlink{classgko_1_1ptr__param_ad1245c2636fdba26d3a3fab9fec5e068}{get}}());\ \}}
\DoxyCodeLine{00514\ \};}
\DoxyCodeLine{00515\ }
\DoxyCodeLine{00516\ }
\DoxyCodeLine{00517\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00518\ }
\DoxyCodeLine{00519\ }
\DoxyCodeLine{00520\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ R,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00521\ std::unique\_ptr<R,\ std::function<void(R*)>>\ copy\_and\_convert\_to\_impl(}
\DoxyCodeLine{00522\ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ T*\ obj)}
\DoxyCodeLine{00523\ \{}
\DoxyCodeLine{00524\ \ \ \ \ \textcolor{keyword}{auto}\ obj\_as\_r\ =\ \textcolor{keyword}{dynamic\_cast<}R*\textcolor{keyword}{>}(obj);}
\DoxyCodeLine{00525\ \ \ \ \ \textcolor{keywordflow}{if}\ (obj\_as\_r\ !=\ \textcolor{keyword}{nullptr}\ \&\&\ obj-\/>get\_executor()\ ==\ exec)\ \{}
\DoxyCodeLine{00526\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ FIXME:\ this\ breaks\ lifetimes}}
\DoxyCodeLine{00527\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \{obj\_as\_r,\ [](R*)\ \{\}\};}
\DoxyCodeLine{00528\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00529\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ copy\ =\ R::create(exec);}
\DoxyCodeLine{00530\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<ConvertibleTo<std::decay\_t<R>}}>>(obj)-\/>\doxymbox{\hyperlink{namespacegko_a7cb327baf9ca9018d06fa5554464d29d}{convert\_to}}(copy);}
\DoxyCodeLine{00531\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \{copy.release(),\ std::default\_delete<R>\{\}\};}
\DoxyCodeLine{00532\ \ \ \ \ \}}
\DoxyCodeLine{00533\ \}}
\DoxyCodeLine{00534\ }
\DoxyCodeLine{00535\ }
\DoxyCodeLine{00536\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ R,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00537\ std::shared\_ptr<R>\ copy\_and\_convert\_to\_impl(}
\DoxyCodeLine{00538\ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ std::shared\_ptr<T>\ obj)}
\DoxyCodeLine{00539\ \{}
\DoxyCodeLine{00540\ \ \ \ \ \textcolor{keyword}{auto}\ obj\_as\_r\ =\ std::dynamic\_pointer\_cast<R>(obj);}
\DoxyCodeLine{00541\ \ \ \ \ \textcolor{keywordflow}{if}\ (obj\_as\_r\ !=\ \textcolor{keyword}{nullptr}\ \&\&\ obj-\/>get\_executor()\ ==\ exec)\ \{}
\DoxyCodeLine{00542\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ obj\_as\_r;}
\DoxyCodeLine{00543\ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00544\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ copy\ =\ R::create(exec);}
\DoxyCodeLine{00545\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<ConvertibleTo<std::decay\_t<R>}}>>(obj.get())-\/>convert\_to(copy);}
\DoxyCodeLine{00546\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \{std::move(copy)\};}
\DoxyCodeLine{00547\ \ \ \ \ \}}
\DoxyCodeLine{00548\ \}}
\DoxyCodeLine{00549\ }
\DoxyCodeLine{00550\ }
\DoxyCodeLine{00551\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00552\ }
\DoxyCodeLine{00553\ }
\DoxyCodeLine{00570\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ R,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00571\ std::unique\_ptr<R,\ std::function<void(R*)>>\ \doxymbox{\hyperlink{namespacegko_ae4916d7f4a38162b665935d0adfb3825}{copy\_and\_convert\_to}}(}
\DoxyCodeLine{00572\ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ T*\ obj)}
\DoxyCodeLine{00573\ \{}
\DoxyCodeLine{00574\ \ \ \ \ \textcolor{keywordflow}{return}\ detail::copy\_and\_convert\_to\_impl<R>(std::move(exec),\ obj);}
\DoxyCodeLine{00575\ \}}
\DoxyCodeLine{00576\ }
\DoxyCodeLine{00577\ }
\DoxyCodeLine{00584\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ R,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00585\ std::unique\_ptr<\textcolor{keyword}{const}\ R,\ std::function<void(\textcolor{keyword}{const}\ R*)>>\ \doxymbox{\hyperlink{namespacegko_ae4916d7f4a38162b665935d0adfb3825}{copy\_and\_convert\_to}}(}
\DoxyCodeLine{00586\ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ \textcolor{keyword}{const}\ T*\ obj)}
\DoxyCodeLine{00587\ \{}
\DoxyCodeLine{00588\ \ \ \ \ \textcolor{keywordflow}{return}\ detail::copy\_and\_convert\_to\_impl<const\ R>(std::move(exec),\ obj);}
\DoxyCodeLine{00589\ \}}
\DoxyCodeLine{00590\ }
\DoxyCodeLine{00591\ }
\DoxyCodeLine{00609\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ R,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00610\ std::shared\_ptr<R>\ \doxymbox{\hyperlink{namespacegko_ae4916d7f4a38162b665935d0adfb3825}{copy\_and\_convert\_to}}(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00611\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::shared\_ptr<T>\ obj)}
\DoxyCodeLine{00612\ \{}
\DoxyCodeLine{00613\ \ \ \ \ \textcolor{keywordflow}{return}\ detail::copy\_and\_convert\_to\_impl<R>(std::move(exec),\ obj);}
\DoxyCodeLine{00614\ \}}
\DoxyCodeLine{00615\ }
\DoxyCodeLine{00616\ }
\DoxyCodeLine{00624\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ R,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00625\ std::shared\_ptr<const\ R>\ \doxymbox{\hyperlink{namespacegko_ae4916d7f4a38162b665935d0adfb3825}{copy\_and\_convert\_to}}(}
\DoxyCodeLine{00626\ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,\ std::shared\_ptr<const\ T>\ obj)}
\DoxyCodeLine{00627\ \{}
\DoxyCodeLine{00628\ \ \ \ \ \textcolor{keywordflow}{return}\ detail::copy\_and\_convert\_to\_impl<const\ R>(std::move(exec),\ obj);}
\DoxyCodeLine{00629\ \}}
\DoxyCodeLine{00630\ }
\DoxyCodeLine{00631\ }
\DoxyCodeLine{00666\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ConcreteObject,\ \textcolor{keyword}{typename}\ PolymorphicBase\ =\ PolymorphicObject>}
\DoxyCodeLine{00667\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicObject}{EnablePolymorphicObject}}}
\DoxyCodeLine{00668\ \ \ \ \ :\ \textcolor{keyword}{public}\ EnableAbstractPolymorphicObject<ConcreteObject,\ PolymorphicBase>\ \{}
\DoxyCodeLine{00669\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00670\ \ \ \ \ \textcolor{keyword}{using\ }EnableAbstractPolymorphicObject<}
\DoxyCodeLine{00671\ \ \ \ \ \ \ \ \ ConcreteObject,\ PolymorphicBase>::EnableAbstractPolymorphicObject;}
\DoxyCodeLine{00672\ }
\DoxyCodeLine{00673\ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ create\_default\_impl(}
\DoxyCodeLine{00674\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec)\textcolor{keyword}{\ const\ override}}
\DoxyCodeLine{00675\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00676\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_base\_of\_v<}
\DoxyCodeLine{00677\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1DistributedBase}{experimental::distributed::DistributedBase}},}
\DoxyCodeLine{00678\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ConcreteObject>)\ \{}
\DoxyCodeLine{00679\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<ConcreteObject>\{}
\DoxyCodeLine{00680\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{new}\ ConcreteObject(exec,\ self()-\/>get\_communicator())\};}
\DoxyCodeLine{00681\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00682\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<ConcreteObject>\{\textcolor{keyword}{new}\ ConcreteObject(exec)\};}
\DoxyCodeLine{00683\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00684\ \ \ \ \ \}}
\DoxyCodeLine{00685\ }
\DoxyCodeLine{00686\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ copy\_from\_impl(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ other)\textcolor{keyword}{\ override}}
\DoxyCodeLine{00687\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00688\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<ConvertibleTo<ConcreteObject>}}>(other)-\/>\doxymbox{\hyperlink{namespacegko_a7cb327baf9ca9018d06fa5554464d29d}{convert\_to}}(self());}
\DoxyCodeLine{00689\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{this};}
\DoxyCodeLine{00690\ \ \ \ \ \}}
\DoxyCodeLine{00691\ }
\DoxyCodeLine{00692\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ copy\_from\_impl(}
\DoxyCodeLine{00693\ \ \ \ \ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ other)\textcolor{keyword}{\ override}}
\DoxyCodeLine{00694\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00695\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<ConvertibleTo<ConcreteObject>}}>(other.get())-\/>move\_to(self());}
\DoxyCodeLine{00696\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{this};}
\DoxyCodeLine{00697\ \ \ \ \ \}}
\DoxyCodeLine{00698\ }
\DoxyCodeLine{00699\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ move\_from\_impl(\doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ other)\textcolor{keyword}{\ override}}
\DoxyCodeLine{00700\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00701\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<ConvertibleTo<ConcreteObject>}}>(other)-\/>\doxymbox{\hyperlink{namespacegko_a6fcc3453bf500454b56a5f2f196b871c}{move\_to}}(self());}
\DoxyCodeLine{00702\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{this};}
\DoxyCodeLine{00703\ \ \ \ \ \}}
\DoxyCodeLine{00704\ }
\DoxyCodeLine{00705\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ move\_from\_impl(}
\DoxyCodeLine{00706\ \ \ \ \ \ \ \ \ std::unique\_ptr<PolymorphicObject>\ other)\textcolor{keyword}{\ override}}
\DoxyCodeLine{00707\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00708\ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{namespacegko_ae3e355a655feea026a7c46814d37a9c9}{as<ConvertibleTo<ConcreteObject>}}>(other.get())-\/>move\_to(self());}
\DoxyCodeLine{00709\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{this};}
\DoxyCodeLine{00710\ \ \ \ \ \}}
\DoxyCodeLine{00711\ }
\DoxyCodeLine{00712\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1PolymorphicObject}{PolymorphicObject}}*\ clear\_impl()\textcolor{keyword}{\ override}}
\DoxyCodeLine{00713\ \textcolor{keyword}{\ \ \ \ }\{}
\DoxyCodeLine{00714\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_base\_of\_v<}
\DoxyCodeLine{00715\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1experimental_1_1distributed_1_1DistributedBase}{experimental::distributed::DistributedBase}},}
\DoxyCodeLine{00716\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ConcreteObject>)\ \{}
\DoxyCodeLine{00717\ \ \ \ \ \ \ \ \ \ \ \ \ *self()\ =\ ConcreteObject\{this-\/>get\_executor(),}
\DoxyCodeLine{00718\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ self()-\/>get\_communicator()\};}
\DoxyCodeLine{00719\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{00720\ \ \ \ \ \ \ \ \ \ \ \ \ *self()\ =\ ConcreteObject\{this-\/>get\_executor()\};}
\DoxyCodeLine{00721\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00722\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{this};}
\DoxyCodeLine{00723\ \ \ \ \ \}}
\DoxyCodeLine{00724\ }
\DoxyCodeLine{00725\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00726\ \ \ \ \ GKO\_ENABLE\_SELF(ConcreteObject);}
\DoxyCodeLine{00727\ \};}
\DoxyCodeLine{00728\ }
\DoxyCodeLine{00729\ }
\DoxyCodeLine{00742\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ConcreteType,\ \textcolor{keyword}{typename}\ ResultType\ =\ ConcreteType>}
\DoxyCodeLine{00743\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnablePolymorphicAssignment}{EnablePolymorphicAssignment}}\ :\ \textcolor{keyword}{public}\ ConvertibleTo<ResultType>\ \{}
\DoxyCodeLine{00744\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00745\ \ \ \ \ \textcolor{keyword}{using\ }result\_type\ =\ ResultType;}
\DoxyCodeLine{00746\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<result\_type>::convert\_to;}
\DoxyCodeLine{00747\ \ \ \ \ \textcolor{keyword}{using\ }ConvertibleTo<result\_type>::move\_to;}
\DoxyCodeLine{00748\ }
\DoxyCodeLine{00749\ \ \ \ \ \textcolor{keywordtype}{void}\ convert\_to(result\_type*\ result)\textcolor{keyword}{\ const\ override\ }\{\ *result\ =\ *self();\ \}}
\DoxyCodeLine{00750\ }
\DoxyCodeLine{00751\ \ \ \ \ \textcolor{keywordtype}{void}\ move\_to(result\_type*\ result)\textcolor{keyword}{\ override\ }\{\ *result\ =\ std::move(*self());\ \}}
\DoxyCodeLine{00752\ }
\DoxyCodeLine{00753\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00754\ \ \ \ \ GKO\_ENABLE\_SELF(ConcreteType);}
\DoxyCodeLine{00755\ \};}
\DoxyCodeLine{00756\ }
\DoxyCodeLine{00757\ }
\DoxyCodeLine{00766\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ConcreteType>}
\DoxyCodeLine{00767\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1EnableCreateMethod}{EnableCreateMethod}}\ \{}
\DoxyCodeLine{00768\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00769\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}...\ Args>}
\DoxyCodeLine{00770\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<ConcreteType>\ create(Args\&\&...\ args)}
\DoxyCodeLine{00771\ \ \ \ \ \{}
\DoxyCodeLine{00772\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<ConcreteType>(}
\DoxyCodeLine{00773\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{new}\ ConcreteType(std::forward<Args>(args)...));}
\DoxyCodeLine{00774\ \ \ \ \ \}}
\DoxyCodeLine{00775\ \};}
\DoxyCodeLine{00776\ }
\DoxyCodeLine{00777\ }
\DoxyCodeLine{00778\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00779\ }
\DoxyCodeLine{00780\ }
\DoxyCodeLine{00781\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_BASE\_POLYMORPHIC\_OBJECT\_HPP\_}}

\end{DoxyCode}
