\doxysection{property\+\_\+tree.\+hpp}
\hypertarget{property__tree_8hpp_source}{}\label{property__tree_8hpp_source}\index{ginkgo/core/config/property\_tree.hpp@{ginkgo/core/config/property\_tree.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2025\ 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\_CONFIG\_PROPERTY\_TREE\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_CONFIG\_PROPERTY\_TREE\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <cstdint>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <limits>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <map>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <stdexcept>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <type\_traits>}}
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }config\ \{}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00028\ \textcolor{keyword}{class\ }\doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}\ final\ \{}
\DoxyCodeLine{00029\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keyword}{using\ }key\_type\ =\ std::string;}
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keyword}{using\ }map\_type\ =\ std::map<key\_type,\ pnode>;}
\DoxyCodeLine{00032\ \ \ \ \ \textcolor{keyword}{using\ }array\_type\ =\ std::vector<pnode>;}
\DoxyCodeLine{00033\ }
\DoxyCodeLine{00037\ \ \ \ \ \textcolor{keyword}{enum\ class}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a2c068169721fba2785b0940c02b912bd}{tag\_t}}\ \{\ empty,\ \doxymbox{\hyperlink{classgko_1_1array}{array}},\ boolean,\ \doxymbox{\hyperlink{namespacegko_af21648097306adbabc6234b4609ce297}{real}},\ integer,\ string,\ map\ \};}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}();}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00049\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_ab907633a3fc1886a3e200362302ddae6}{pnode}}(\textcolor{keywordtype}{bool}\ \textcolor{keywordtype}{boolean});}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T,}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::enable\_if\_t<std::is\_integral<T>::value>*\ =\ \textcolor{keyword}{nullptr}>}
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}(T\ integer);}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_ab279fc7dcff62ebdfc1fa0e9d389fa2e}{pnode}}(\textcolor{keyword}{const}\ std::string\&\ str);}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_adfdf9bd96663228ce27630f79fed3069}{pnode}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ str);}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00081\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a9348847c0a14ef8904fd0e4a9759efad}{pnode}}(\textcolor{keywordtype}{double}\ \doxymbox{\hyperlink{namespacegko_af21648097306adbabc6234b4609ce297}{real}});}
\DoxyCodeLine{00082\ }
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a34a8fa6b22496f805d9f06bac3f96cf6}{pnode}}(\textcolor{keyword}{const}\ array\_type\&\ \doxymbox{\hyperlink{classgko_1_1array}{array}});}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00095\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a3b5eac91e5865801b16dd346b47fa0d2}{pnode}}(\textcolor{keyword}{const}\ map\_type\&\ map);}
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00100\ \ \ \ \ \textcolor{keyword}{explicit}\ \textcolor{keyword}{operator}\ bool()\ const\ noexcept;}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00105\ \ \ \ \ \textcolor{keywordtype}{bool}\ operator==(const\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}\&\ rhs)\ const;}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{keywordtype}{bool}\ operator!=(const\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}\&\ rhs)\ const;}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00117\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a2c068169721fba2785b0940c02b912bd}{tag\_t}}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_ab9e069d8947db51c15d1a68a0b1fa14f}{get\_tag}}()\ const;}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00125\ \ \ \ \ const\ array\_type\&\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_ad04a721d30a9da5eadd49f001c956008}{get\_array}}()\ const;}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00133\ \ \ \ \ const\ map\_type\&\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a4d60ee4ec012108873105d19e5fdd2e0}{get\_map}}()\ const;}
\DoxyCodeLine{00134\ }
\DoxyCodeLine{00142\ \ \ \ \ \textcolor{keywordtype}{bool}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a47c8d2647021b0ea15841387db66f654}{get\_boolean}}()\ const;}
\DoxyCodeLine{00143\ }
\DoxyCodeLine{00151\ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::int64\_t\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_aed54bb5d0cac77934778c8a81e347652}{get\_integer}}()\ const;}
\DoxyCodeLine{00152\ }
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{keywordtype}{double}\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a6a15e501427aec38f5950dce193ffdb9}{get\_real}}()\ const;}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00167\ \ \ \ \ const\ \doxymbox{\hyperlink{namespacestd}{std}}::\textcolor{keywordtype}{string}\&\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_aa6126118d402951ac36fcb4195788ed9}{get\_string}}()\ const;}
\DoxyCodeLine{00168\ }
\DoxyCodeLine{00179\ \ \ \ \ const\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}\&\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a844411ed0812dac833330efca9f2a1d3}{get}}(const\ \doxymbox{\hyperlink{namespacestd}{std}}::\textcolor{keywordtype}{string}\&\ key)\ const;}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00189\ \ \ \ \ const\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}\&\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a844411ed0812dac833330efca9f2a1d3}{get}}(\textcolor{keywordtype}{int}\ index)\ const;}
\DoxyCodeLine{00190\ }
\DoxyCodeLine{00191\ private:}
\DoxyCodeLine{00192\ \ \ \ \ \textcolor{keywordtype}{void}\ throw\_if\_not\_contain(\doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a2c068169721fba2785b0940c02b912bd}{tag\_t}}\ tag)\ const;}
\DoxyCodeLine{00193\ }
\DoxyCodeLine{00194\ \ \ \ \ static\ const\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode}}\&\ empty\_node();}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00196\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a2c068169721fba2785b0940c02b912bd}{tag\_t}}\ tag\_;}
\DoxyCodeLine{00197\ \ \ \ \ array\_type\ array\_;\ \ \textcolor{comment}{//\ for\ array}}
\DoxyCodeLine{00198\ \ \ \ \ map\_type\ map\_;\ \ \ \ \ \ \textcolor{comment}{//\ for\ map}}
\DoxyCodeLine{00199\ \ \ \ \ \textcolor{comment}{//\ value}}
\DoxyCodeLine{00200\ \ \ \ \ \doxymbox{\hyperlink{namespacestd}{std}}::\textcolor{keywordtype}{string}\ str\_;}
\DoxyCodeLine{00201\ \ \ \ \ union\ \{}
\DoxyCodeLine{00202\ \ \ \ \ \ \ \ \ std::int64\_t\ integer\_;}
\DoxyCodeLine{00203\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ real\_;}
\DoxyCodeLine{00204\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ boolean\_;}
\DoxyCodeLine{00205\ \ \ \ \ \}\ union\_data\_;}
\DoxyCodeLine{00206\ \};}
\DoxyCodeLine{00207\ }
\DoxyCodeLine{00208\ }
\DoxyCodeLine{00209\ template\ <typename\ T,\ std::enable\_if\_t<std::is\_integral<T>::value>*>}
\DoxyCodeLine{00210\ \doxymbox{\hyperlink{classgko_1_1config_1_1pnode_abdcb6d2251d263a0e6326af8d42fc770}{pnode::pnode}}(T\ integer)\ :\ tag\_(\doxymbox{\hyperlink{classgko_1_1config_1_1pnode_a2c068169721fba2785b0940c02b912bd}{tag\_t}}::integer)}
\DoxyCodeLine{00211\ \{}
\DoxyCodeLine{00212\ \ \ \ \ \textcolor{keywordflow}{if}\ (integer\ >\ std::numeric\_limits<std::int64\_t>::max()\ ||}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ (std::is\_signed<T>::value\ \&\&}
\DoxyCodeLine{00214\ \ \ \ \ \ \ \ \ \ integer\ <\ std::numeric\_limits<std::int64\_t>::min()))\ \{}
\DoxyCodeLine{00215\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::runtime\_error(\textcolor{stringliteral}{"{}The\ input\ is\ out\ of\ the\ range\ of\ int64\_t."{}});}
\DoxyCodeLine{00216\ \ \ \ \ \}}
\DoxyCodeLine{00217\ \ \ \ \ union\_data\_.integer\_\ =\ \textcolor{keyword}{static\_cast<}std::int64\_t\textcolor{keyword}{>}(integer);}
\DoxyCodeLine{00218\ \}}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00220\ }
\DoxyCodeLine{00221\ \}\ \ \textcolor{comment}{//\ namespace\ config}}
\DoxyCodeLine{00222\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00223\ }
\DoxyCodeLine{00224\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_CONFIG\_PROPERTY\_TREE\_HPP\_}}

\end{DoxyCode}
