\doxysection{Parameter.\+hpp}
\hypertarget{Parameter_8hpp_source}{}\label{Parameter_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Parameter.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Parameter.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_PARAMETER\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_PARAMETER\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <set>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <variant>}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}Py.hpp"{}}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{keyword}{class\ }Parameter}
\DoxyCodeLine{00009\ \{}
\DoxyCodeLine{00010\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00011\ \ \ \ \ Parameter(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ \textcolor{keyword}{const}\ std::function<\textcolor{keywordtype}{void}(\textcolor{keyword}{const}\ Parameter\&)>\ \&commit);}
\DoxyCodeLine{00012\ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ name()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mName;\ \}}
\DoxyCodeLine{00013\ \ \ \ \ \textcolor{keywordtype}{char}\ dtype()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00014\ \ \ \ \ \textcolor{keywordtype}{void}\ set(\textcolor{keywordtype}{double});}
\DoxyCodeLine{00015\ \ \ \ \ \textcolor{keywordtype}{void}\ set(int64\_t);}
\DoxyCodeLine{00016\ \ \ \ \ \textcolor{keywordtype}{void}\ set(\textcolor{keyword}{const}\ std::string\&);}
\DoxyCodeLine{00017\ \ \ \ \ \textcolor{keywordtype}{void}\ set(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *s)\ \{\ set(std::string(s));\ \}}
\DoxyCodeLine{00018\ \ \ \ \ \textcolor{keywordtype}{void}\ set(\textcolor{keywordtype}{bool});}
\DoxyCodeLine{00019\ \ \ \ \ \textcolor{keywordtype}{void}\ set(PyObject\ *);}
\DoxyCodeLine{00020\ \ \ \ \ \textcolor{keywordtype}{void}\ setLimits(\textcolor{keywordtype}{double}\ def,\ \textcolor{keywordtype}{double}\ min,\ \textcolor{keywordtype}{double}\ max);}
\DoxyCodeLine{00021\ \ \ \ \ \textcolor{keywordtype}{void}\ setLimits(int64\_t\ def,\ int64\_t\ min,\ int64\_t\ max);}
\DoxyCodeLine{00022\ \ \ \ \ \textcolor{keywordtype}{void}\ addEnum(\textcolor{keyword}{const}\ std::string\ \&s)\ \{\ mEnum.insert(s);\ \}}
\DoxyCodeLine{00023\ \ \ \ \ \textcolor{keywordtype}{void}\ setVisible(\textcolor{keywordtype}{bool}\ b)\ \{\ mVisible\ =\ b;\ \}}
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keywordtype}{bool}\ visible()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mVisible;\ \}}
\DoxyCodeLine{00025\ \ \ \ \ \textcolor{keywordtype}{void}\ init(\textcolor{keywordtype}{bool}\ b)\ \{\ mValue\ =\ b;\ \}}
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keywordtype}{void}\ init(\textcolor{keyword}{const}\ std::string\ \&s)\ \{\ mValue\ =\ s;\ \}}
\DoxyCodeLine{00027\ \ \ \ \ \textcolor{keywordtype}{void}\ init(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *s)\ \{\ init(std::string(s));\ \}}
\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keywordtype}{void}\ setNotifier(\textcolor{keyword}{const}\ std::function<\textcolor{keywordtype}{void}()>\ \&notify)\ \{\ mNotify\ =\ notify;\ \}}
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keywordtype}{double}\ min()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mLimitMin;\ \}}
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keywordtype}{double}\ max()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mLimitMax;\ \}}
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keywordtype}{double}\ d()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00032\ \ \ \ \ \textcolor{keywordtype}{bool}\ b()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ s()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keyword}{const}\ std::set<std::string>\&\ getEnum()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mEnum;\ \}}
\DoxyCodeLine{00035\ \ \ \ \ int64\_t\ i()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00036\ \ \ \ \ int64\_t\ as\_i()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00037\ \ \ \ \ \textcolor{keywordtype}{double}\ as\_d()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00038\ \ \ \ \ std::string\ as\_s()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keywordtype}{bool}\ as\_b()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ \textcolor{keywordtype}{bool}\ is\_a()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ std::holds\_alternative<T>(mValue);\ \}}
\DoxyCodeLine{00041\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ mName;}
\DoxyCodeLine{00043\ \ \ \ \ std::variant<double,\ int64\_t,\ std::string,\ bool>\ mValue;}
\DoxyCodeLine{00044\ \ \ \ \ std::set<std::string>\ mEnum;}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keywordtype}{double}\ mLimitMin\{-\/std::numeric\_limits<double>::infinity()\};}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keywordtype}{double}\ mLimitMax\{+std::numeric\_limits<double>::infinity()\};}
\DoxyCodeLine{00047\ \ \ \ \ \textcolor{keyword}{const}\ std::function<void(\textcolor{keyword}{const}\ Parameter\&)>\ mCommit;}
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{keywordtype}{bool}\ mVisible\{\textcolor{keyword}{true}\};}
\DoxyCodeLine{00049\ \ \ \ \ std::function<void()>\ mNotify;}
\DoxyCodeLine{00050\ \};}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{char}\ Parameter::dtype()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00053\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00054\ \ \ \ \ assert(mValue.index()\ >=\ 0\ \&\&\ mValue.index()\ <\ 4);}
\DoxyCodeLine{00055\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{stringliteral}{"{}disb"{}}[mValue.index()];}
\DoxyCodeLine{00056\ \}}
\DoxyCodeLine{00057\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{double}\ Parameter::d()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00058\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<double>(mValue);}
\DoxyCodeLine{00060\ \}}
\DoxyCodeLine{00061\ \textcolor{keyword}{inline}\ int64\_t\ Parameter::i()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00062\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<int64\_t>(mValue);}
\DoxyCodeLine{00064\ \}}
\DoxyCodeLine{00065\ \textcolor{keyword}{inline}\ \textcolor{keyword}{const}\ std::string\&\ Parameter::s()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00066\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<std::string>(mValue);}
\DoxyCodeLine{00068\ \}}
\DoxyCodeLine{00069\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Parameter::b()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00070\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<bool>(mValue);}
\DoxyCodeLine{00072\ \}}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00074\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_PARAMETER\_H}}

\end{DoxyCode}
