\doxysection{Py\+Object.\+hpp}
\hypertarget{PyObject_8hpp_source}{}\label{PyObject_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/PyObject.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/PyObject.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#include\ "{}Py.hpp"{}}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{keyword}{namespace\ }py}
\DoxyCodeLine{00005\ \{}
\DoxyCodeLine{00006\ }
\DoxyCodeLine{00008\ \textcolor{keyword}{class\ }Object}
\DoxyCodeLine{00009\ \{}
\DoxyCodeLine{00010\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00011\ \ \ \ \ Object(PyObject\ *py)\ :\ mPy(py)\ \{\ \}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \ \ \ \ \textcolor{comment}{//\ These\ create\ a\ new\ reference:}}
\DoxyCodeLine{00014\ \ \ \ \ Object(\textcolor{keywordtype}{bool});}
\DoxyCodeLine{00015\ \ \ \ \ Object(\textcolor{keywordtype}{double});}
\DoxyCodeLine{00016\ \ \ \ \ Object(\textcolor{keywordtype}{long});}
\DoxyCodeLine{00017\ \ \ \ \ Object(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *);}
\DoxyCodeLine{00018\ \ \ \ \ Object(\textcolor{keyword}{const}\ std::string\&);}
\DoxyCodeLine{00019\ \ \ \ \ Object(\textcolor{keyword}{const}\ Point\_2\&);}
\DoxyCodeLine{00020\ \ \ \ \ Object(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00021\ \ \ \ \ Object(\textcolor{keyword}{const}\ \mbox{\hyperlink{classIPoint__3}{IPoint\_3}}\&);}
\DoxyCodeLine{00022\ \ \ \ \ Object(\textcolor{keyword}{const}\ Bbox\_2\&);}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keyword}{static}\ Object\ new\_List(uint\ n,\ PyObject\ *v\ =\ 0);}
\DoxyCodeLine{00025\ \ \ \ \ \textcolor{keyword}{static}\ Object\ new\_TupleOfLongs(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&v,\ Real\ s);}
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ \textcolor{keyword}{static}\ Object\ new\_TupleOfLongs(\textcolor{keyword}{const}\ T\ *,\ uint\ size);}
\DoxyCodeLine{00027\ \ \ \ \ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ \textcolor{keyword}{static}\ Object\ new\_ListFrom(\textcolor{keyword}{const}\ std::vector<T>\&,\ \textcolor{keyword}{auto}\&\&...);}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keyword}{const}\ Object\&\ incRef()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keyword}{const}\ Object\&\ decRef()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \ \ \ \ PyObject\ **o()\ \{\ \textcolor{keywordflow}{return}\ \&mPy;\ \}}
\DoxyCodeLine{00033\ \ \ \ \ PyObject\ *operator*()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPy;\ \}}
\DoxyCodeLine{00034\ }
\DoxyCodeLine{00035\ \ \ \ \ Object\ at(uint\ i)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00036\ \ \ \ \ Object\ elem(uint\ i,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ 0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00037\ \ \ \ \ Object\ item(uint\ i)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00038\ \ \ \ \ Object\ item(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keywordtype}{void}\ setElem(uint\ i,\ \textcolor{keyword}{const}\ Object\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keywordtype}{void}\ setElem(uint\ i,\ PyObject\ *)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keywordtype}{void}\ setItem(uint\ i,\ \textcolor{keyword}{const}\ Object\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keywordtype}{void}\ setItem(uint\ i,\ PyObject\ *)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keywordtype}{void}\ setDictItem(uint\ i,\ PyObject\ *)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keywordtype}{void}\ setItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ \textcolor{keyword}{const}\ Object\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keywordtype}{void}\ refItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ \textcolor{keyword}{const}\ Object\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00047\ \ \ \ \ \textcolor{keywordtype}{void}\ setItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ PyObject\ *)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{keywordtype}{void}\ refItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ PyObject\ *)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keywordtype}{bool}\ isNone()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPy\ ==\ Py\_None;\ \}}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keywordtype}{bool}\ isDict()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keywordtype}{bool}\ isList()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{keywordtype}{bool}\ isList(uint\ n)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasListItem(uint\ i)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00055\ \ \ \ \ \textcolor{keywordtype}{bool}\ isTuple()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{keywordtype}{bool}\ isTuple(uint\ n)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasTupleElem(uint\ i)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keywordtype}{bool}\ isTupleOrList(uint\ n)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00060\ \ \ \ \ uint\ listSize(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ list"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ \ \ \ \ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ T\ asIntegerContainer()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ T\ asStringContainer()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keyword}{operator}\ bool()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00066\ \ \ \ \ \textcolor{comment}{//\ Amazing\ C++\ feature:\ disable\ cast\ to\ ints}}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T,\ \textcolor{keyword}{typename}\ =\ std::enable\_if\_t<std::is\_\textcolor{keywordtype}{int}egral\_v<T>>>}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keyword}{operator}\ T()\ \textcolor{keyword}{const}\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00069\ }
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keywordtype}{bool}\ isBool()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keywordtype}{bool}\ isBool(\textcolor{keywordtype}{bool}\ value)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keywordtype}{bool}\ isFloat()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keywordtype}{bool}\ isLong()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keywordtype}{bool}\ isNumber()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keywordtype}{bool}\ asBool(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ boolean"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordtype}{bool}\ toBool()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordtype}{double}\ asDouble(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ float"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00078\ \ \ \ \ \textcolor{keywordtype}{double}\ toDouble(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ number"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{keywordtype}{long}\ asLong()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00080\ \ \ \ \ \textcolor{keywordtype}{long}\ toLong(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ number"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keywordtype}{bool}\ isString()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00083\ \ \ \ \ std::string\ asString(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ string"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00084\ \ \ \ \ std::string\ toString()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00085\ \ \ \ \ std::string\_view\ asStringView(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ string"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keywordtype}{bool}\ isVector(uint\ n)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keywordtype}{bool}\ isLongVector(uint\ n)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00089\ \ \ \ \ \textcolor{keywordtype}{bool}\ isPoint\_25()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00090\ \ \ \ \ \mbox{\hyperlink{classIPoint__2}{IPoint\_2}}\ asIPoint\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 2D\ integer\ point"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00091\ \ \ \ \ \mbox{\hyperlink{classIPoint__3}{IPoint\_3}}\ asIPoint\_3(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 3D\ integer\ point"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00092\ \ \ \ \ \mbox{\hyperlink{classIVector__2}{IVector\_2}}\ asIVector\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 2D\ integer\ vector"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00093\ \ \ \ \ \mbox{\hyperlink{classIVector__3}{IVector\_3}}\ asIVector\_3(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 3D\ integer\ vector"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00094\ \ \ \ \ Vector\_2\ asVector\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 2D\ vector"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00095\ \ \ \ \ Point\_2\ asPoint\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 2D\ point"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00096\ \ \ \ \ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ asPoint\_25(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err\ =\ \textcolor{stringliteral}{"{}object\ is\ not\ a\ 2.5D\ point"{}})\ \textcolor{keyword}{const};}
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00098\ \ \ \ \ ::Bbox\_2\ asBbox\_2()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00099\ \ \ \ \ \mbox{\hyperlink{structIBox__3}{::IBox\_3}}\ asIBox\_3()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00100\ }
\DoxyCodeLine{00101\ \ \ \ \ uint64\_t\ asBitmask(uint\ size)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00102\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00103\ \ \ \ \ PyObject\ *mPy;}
\DoxyCodeLine{00104\ \};}
\DoxyCodeLine{00105\ }
\DoxyCodeLine{00106\ \textcolor{keyword}{class\ }BorrowedRef}
\DoxyCodeLine{00107\ \{}
\DoxyCodeLine{00108\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00109\ \ \ \ \ BorrowedRef(PyObject\ *py\ =\ 0)\ :\ mRef(py)\ \{\ \}}
\DoxyCodeLine{00110\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}*\ operator-\/>()\ \{\ \textcolor{keywordflow}{return}\ \&mRef;\ \}}
\DoxyCodeLine{00111\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}\&\ operator*()\ \{\ \textcolor{keywordflow}{return}\ mRef;\ \}}
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keyword}{operator}\ bool()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ (\textcolor{keywordtype}{bool})mRef;\ \}}
\DoxyCodeLine{00113\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00114\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ mRef;}
\DoxyCodeLine{00115\ \};}
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00117\ \textcolor{keyword}{class\ }ObjectRef}
\DoxyCodeLine{00118\ \{}
\DoxyCodeLine{00119\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00120\ \ \ \ \ ObjectRef(PyObject\ *,\ uint\ refs\ =\ 0);}
\DoxyCodeLine{00121\ \ \ \ \ \string~ObjectRef();}
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordtype}{void}\ reset(PyObject\ *,\ uint\ refs\ =\ 0);}
\DoxyCodeLine{00123\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}*\ operator-\/>()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ \&mRef;\ \}}
\DoxyCodeLine{00124\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\&\ operator*()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mRef;\ \}}
\DoxyCodeLine{00125\ \ \ \ \ PyObject\ *getRef()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00126\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00127\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ mRef;}
\DoxyCodeLine{00128\ \};}
\DoxyCodeLine{00129\ \textcolor{keyword}{inline}\ ObjectRef::ObjectRef(PyObject\ *py,\ uint\ refs)\ :\ mRef(py)}
\DoxyCodeLine{00130\ \{}
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{keywordflow}{while}\ (refs-\/-\/)}
\DoxyCodeLine{00132\ \ \ \ \ \ \ \ \ mRef.incRef();}
\DoxyCodeLine{00133\ \}}
\DoxyCodeLine{00134\ \textcolor{keyword}{inline}\ ObjectRef::\string~ObjectRef()}
\DoxyCodeLine{00135\ \{}
\DoxyCodeLine{00136\ \ \ \ \ mRef.decRef();}
\DoxyCodeLine{00137\ \}}
\DoxyCodeLine{00138\ \textcolor{keyword}{inline}\ PyObject\ *ObjectRef::getRef()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00139\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00140\ \ \ \ \ \textcolor{keywordflow}{return}\ *mRef.incRef();}
\DoxyCodeLine{00141\ \}}
\DoxyCodeLine{00142\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ ObjectRef::reset(PyObject\ *py,\ uint\ refs)}
\DoxyCodeLine{00143\ \{}
\DoxyCodeLine{00144\ \ \ \ \ \textcolor{keywordflow}{if}\ (py\ \&\&\ py\ ==\ *mRef)}
\DoxyCodeLine{00145\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::runtime\_error(\textcolor{stringliteral}{"{}objectref\ reset\ object\ must\ differ"{}});}
\DoxyCodeLine{00146\ \ \ \ \ \textcolor{keywordflow}{if}\ (refs\ \&\&\ !py)}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::runtime\_error(\textcolor{stringliteral}{"{}objectref\ asked\ to\ reference\ 0"{}});}
\DoxyCodeLine{00148\ \ \ \ \ \textcolor{keywordflow}{while}\ (refs-\/-\/)}
\DoxyCodeLine{00149\ \ \ \ \ \ \ \ \ Py\_INCREF(py);}
\DoxyCodeLine{00150\ \ \ \ \ mRef.decRef();}
\DoxyCodeLine{00151\ \ \ \ \ *(mRef.o())\ =\ py;}
\DoxyCodeLine{00152\ \}}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00154\ \textcolor{keyword}{struct\ }DictIterator}
\DoxyCodeLine{00155\ \{}
\DoxyCodeLine{00156\ \ \ \ \ DictIterator(PyObject\ *py);}
\DoxyCodeLine{00157\ \ \ \ \ \textcolor{keywordtype}{bool}\ next();}
\DoxyCodeLine{00158\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ d;}
\DoxyCodeLine{00159\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ k;}
\DoxyCodeLine{00160\ \ \ \ \ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ v;}
\DoxyCodeLine{00161\ \ \ \ \ Py\_ssize\_t\ pos\{0\};}
\DoxyCodeLine{00162\ \};}
\DoxyCodeLine{00163\ \textcolor{keyword}{inline}\ DictIterator::DictIterator(PyObject\ *py)\ :\ d(py),\ k(Py\_None),\ v(Py\_None)}
\DoxyCodeLine{00164\ \{}
\DoxyCodeLine{00165\ \ \ \ \ \textcolor{keywordflow}{if}\ (!d.isDict())}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}object\ is\ not\ a\ dictionary"{}});}
\DoxyCodeLine{00167\ \}}
\DoxyCodeLine{00168\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ DictIterator::next()}
\DoxyCodeLine{00169\ \{}
\DoxyCodeLine{00170\ \ \ \ \ \textcolor{keywordflow}{return}\ PyDict\_Next(*d,\ \&pos,\ k.o(),\ v.o());}
\DoxyCodeLine{00171\ \}}
\DoxyCodeLine{00172\ }
\DoxyCodeLine{00173\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keywordtype}{bool}\ b)\ :\ mPy(PyBool\_FromLong(b))}
\DoxyCodeLine{00174\ \{}
\DoxyCodeLine{00175\ \}}
\DoxyCodeLine{00176\ }
\DoxyCodeLine{00177\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keywordtype}{double}\ d)\ :\ mPy(PyFloat\_FromDouble(d))}
\DoxyCodeLine{00178\ \{}
\DoxyCodeLine{00179\ \}}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00181\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keywordtype}{long}\ l)\ :\ mPy(PyLong\_FromLong(l))}
\DoxyCodeLine{00182\ \{}
\DoxyCodeLine{00183\ \}}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00185\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *s)\ :\ mPy(PyUnicode\_FromString(s))}
\DoxyCodeLine{00186\ \{}
\DoxyCodeLine{00187\ \}}
\DoxyCodeLine{00188\ }
\DoxyCodeLine{00189\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keyword}{const}\ std::string\ \&s)\ :\ mPy(PyUnicode\_FromStringAndSize(s.c\_str(),\ s.size()))}
\DoxyCodeLine{00190\ \{}
\DoxyCodeLine{00191\ \}}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keyword}{const}\ Point\_2\ \&v)\ :\ mPy(PyTuple\_New(2))}
\DoxyCodeLine{00194\ \{}
\DoxyCodeLine{00195\ \ \ \ \ PyTuple\_SetItem(mPy,\ 0,\ PyFloat\_FromDouble(v.x()));}
\DoxyCodeLine{00196\ \ \ \ \ PyTuple\_SetItem(mPy,\ 1,\ PyFloat\_FromDouble(v.y()));}
\DoxyCodeLine{00197\ \}}
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00199\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keyword}{const}\ Point\_25\ \&v)\ :\ mPy(PyTuple\_New(3))}
\DoxyCodeLine{00200\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00201\ \ \ \ \ PyTuple\_SetItem(mPy,\ 0,\ PyFloat\_FromDouble(v.x()));}
\DoxyCodeLine{00202\ \ \ \ \ PyTuple\_SetItem(mPy,\ 1,\ PyFloat\_FromDouble(v.y()));}
\DoxyCodeLine{00203\ \ \ \ \ PyTuple\_SetItem(mPy,\ 2,\ PyLong\_FromLong(v.z()));}
\DoxyCodeLine{00204\ \}}
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00206\ \textcolor{keyword}{inline}\ Object::Object(\textcolor{keyword}{const}\ IPoint\_3\ \&v)\ :\ mPy(PyTuple\_New(3))}
\DoxyCodeLine{00207\ \{}
\DoxyCodeLine{00208\ \ \ \ \ PyTuple\_SetItem(mPy,\ 0,\ PyLong\_FromLong(v.x));}
\DoxyCodeLine{00209\ \ \ \ \ PyTuple\_SetItem(mPy,\ 1,\ PyLong\_FromLong(v.y));}
\DoxyCodeLine{00210\ \ \ \ \ PyTuple\_SetItem(mPy,\ 2,\ PyLong\_FromLong(v.z));}
\DoxyCodeLine{00211\ \}}
\DoxyCodeLine{00212\ }
\DoxyCodeLine{00213\ \textcolor{keyword}{inline}\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\&\ Object::incRef()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00214\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00215\ \ \ \ \ \textcolor{keywordflow}{if}\ (mPy)}
\DoxyCodeLine{00216\ \ \ \ \ \ \ \ \ Py\_INCREF(mPy);}
\DoxyCodeLine{00217\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00218\ \}}
\DoxyCodeLine{00219\ \textcolor{keyword}{inline}\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\&\ Object::decRef()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00220\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00221\ \ \ \ \ \textcolor{keywordflow}{if}\ (mPy)}
\DoxyCodeLine{00222\ \ \ \ \ \ \ \ \ Py\_DECREF(mPy);}
\DoxyCodeLine{00223\ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{00224\ \}}
\DoxyCodeLine{00225\ }
\DoxyCodeLine{00226\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::new\_List(uint\ n,\ PyObject\ *v)}
\DoxyCodeLine{00227\ \{}
\DoxyCodeLine{00228\ \ \ \ \ \textcolor{keyword}{auto}\ py\ =\ PyList\_New(n);}
\DoxyCodeLine{00229\ \ \ \ \ \textcolor{keywordflow}{if}\ (v)}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (uint\ i\ =\ 0;\ i\ <\ n;\ ++i)}
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ \ \ \ \ PyList\_SetItem(py,\ i,\ NewRef(v));}
\DoxyCodeLine{00232\ \ \ \ \ \textcolor{keywordflow}{return}\ Object(py);}
\DoxyCodeLine{00233\ \}}
\DoxyCodeLine{00234\ }
\DoxyCodeLine{00235\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::new\_ListFrom(\textcolor{keyword}{const}\ std::vector<T>\ \&data,\ \textcolor{keyword}{auto}\&\&...\ args)}
\DoxyCodeLine{00236\ \{}
\DoxyCodeLine{00237\ \ \ \ \ \textcolor{keyword}{auto}\ py\ =\ PyList\_New(data.size());}
\DoxyCodeLine{00238\ \ \ \ \ \textcolor{keywordflow}{for}\ (uint\ i\ =\ 0;\ i\ <\ data.size();\ ++i)}
\DoxyCodeLine{00239\ \ \ \ \ \ \ \ \ PyList\_SetItem(py,\ i,\ data[i].getPy(std::forward<\textcolor{keyword}{decltype}(args)>(args)...));}
\DoxyCodeLine{00240\ \ \ \ \ \textcolor{keywordflow}{return}\ Object(py);}
\DoxyCodeLine{00241\ \}}
\DoxyCodeLine{00242\ }
\DoxyCodeLine{00243\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::new\_TupleOfLongs(\textcolor{keyword}{const}\ Point\_25\ \&v,\ Real\ s)}
\DoxyCodeLine{00244\ \{}
\DoxyCodeLine{00245\ \ \ \ \ \textcolor{keyword}{auto}\ py\ =\ PyTuple\_New(3);}
\DoxyCodeLine{00246\ \ \ \ \ PyTuple\_SetItem(py,\ 0,\ PyFloat\_FromDouble(v.x()\ *\ s));}
\DoxyCodeLine{00247\ \ \ \ \ PyTuple\_SetItem(py,\ 1,\ PyFloat\_FromDouble(v.y()\ *\ s));}
\DoxyCodeLine{00248\ \ \ \ \ PyTuple\_SetItem(py,\ 2,\ PyLong\_FromLong(v.z()));}
\DoxyCodeLine{00249\ \ \ \ \ \textcolor{keywordflow}{return}\ Object(py);}
\DoxyCodeLine{00250\ \}}
\DoxyCodeLine{00251\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::new\_TupleOfLongs(\textcolor{keyword}{const}\ T\ *array,\ uint\ size)}
\DoxyCodeLine{00252\ \{}
\DoxyCodeLine{00253\ \ \ \ \ \textcolor{keyword}{auto}\ py\ =\ PyTuple\_New(size);}
\DoxyCodeLine{00254\ \ \ \ \ \textcolor{keywordflow}{for}\ (uint\ i\ =\ 0;\ i\ <\ size;\ ++i)}
\DoxyCodeLine{00255\ \ \ \ \ \ \ \ \ PyTuple\_SetItem(py,\ i,\ PyLong\_FromLong(array[i]));}
\DoxyCodeLine{00256\ \ \ \ \ \textcolor{keywordflow}{return}\ Object(py);}
\DoxyCodeLine{00257\ \}}
\DoxyCodeLine{00258\ }
\DoxyCodeLine{00259\ \textcolor{keyword}{inline}\ Object::operator\ bool()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00260\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00261\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ mPy\ !=\ Py\_None;}
\DoxyCodeLine{00262\ \}}
\DoxyCodeLine{00263\ }
\DoxyCodeLine{00264\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isBool()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00265\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00266\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyBool\_Check(mPy);}
\DoxyCodeLine{00267\ \}}
\DoxyCodeLine{00268\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isBool(\textcolor{keywordtype}{bool}\ value)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00269\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00270\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ ==\ (value\ ?\ Py\_True\ :\ Py\_False);}
\DoxyCodeLine{00271\ \}}
\DoxyCodeLine{00272\ }
\DoxyCodeLine{00273\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isFloat()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00274\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00275\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyFloat\_Check(mPy);}
\DoxyCodeLine{00276\ \}}
\DoxyCodeLine{00277\ }
\DoxyCodeLine{00278\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isLong()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00279\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00280\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyLong\_Check(mPy);}
\DoxyCodeLine{00281\ \}}
\DoxyCodeLine{00282\ }
\DoxyCodeLine{00283\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isNumber()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00284\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00285\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyNumber\_Check(mPy);}
\DoxyCodeLine{00286\ \}}
\DoxyCodeLine{00287\ }
\DoxyCodeLine{00288\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::asBool(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00289\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00290\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isBool())}
\DoxyCodeLine{00291\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00292\ \ \ \ \ \textcolor{keywordflow}{return}\ Py\_IsTrue(mPy);}
\DoxyCodeLine{00293\ \}}
\DoxyCodeLine{00294\ }
\DoxyCodeLine{00295\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::toBool()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00296\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00297\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ Py\_IsTrue(mPy);}
\DoxyCodeLine{00298\ \}}
\DoxyCodeLine{00299\ }
\DoxyCodeLine{00300\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{double}\ Object::asDouble(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00301\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00302\ \ \ \ \ \textcolor{keywordflow}{if}\ (!isFloat())}
\DoxyCodeLine{00303\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00304\ \ \ \ \ \textcolor{keywordflow}{return}\ PyFloat\_AsDouble(mPy);}
\DoxyCodeLine{00305\ \}}
\DoxyCodeLine{00306\ }
\DoxyCodeLine{00307\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{double}\ Object::toDouble(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00308\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00309\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isNumber())}
\DoxyCodeLine{00310\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00311\ \ \ \ \ \textcolor{keywordflow}{if}\ (isFloat())}
\DoxyCodeLine{00312\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ asDouble();}
\DoxyCodeLine{00313\ \ \ \ \ \textcolor{keyword}{auto}\ F\ =\ PyNumber\_Float(mPy);}
\DoxyCodeLine{00314\ \ \ \ \ assert(F);}
\DoxyCodeLine{00315\ \ \ \ \ \textcolor{keywordflow}{if}\ (!F)}
\DoxyCodeLine{00316\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::numeric\_limits<double>::quiet\_NaN();}
\DoxyCodeLine{00317\ \ \ \ \ \textcolor{keyword}{auto}\ d\ =\ PyFloat\_AsDouble(F);}
\DoxyCodeLine{00318\ \ \ \ \ Py\_DECREF(F);}
\DoxyCodeLine{00319\ \ \ \ \ \textcolor{keywordflow}{return}\ d;}
\DoxyCodeLine{00320\ \}}
\DoxyCodeLine{00321\ }
\DoxyCodeLine{00322\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{long}\ Object::asLong()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00323\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00324\ \ \ \ \ assert(isLong());}
\DoxyCodeLine{00325\ \ \ \ \ \textcolor{keywordflow}{return}\ PyLong\_AsLong(mPy);}
\DoxyCodeLine{00326\ \}}
\DoxyCodeLine{00327\ }
\DoxyCodeLine{00328\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{long}\ Object::toLong(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00329\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00330\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !PyNumber\_Check(mPy))}
\DoxyCodeLine{00331\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00332\ \ \ \ \ \textcolor{keywordflow}{if}\ (isLong())}
\DoxyCodeLine{00333\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ asLong();}
\DoxyCodeLine{00334\ \ \ \ \ \textcolor{keyword}{auto}\ L\ =\ PyNumber\_Long(mPy);}
\DoxyCodeLine{00335\ \ \ \ \ assert(L);}
\DoxyCodeLine{00336\ \ \ \ \ \textcolor{keywordflow}{if}\ (!L)}
\DoxyCodeLine{00337\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0L;}
\DoxyCodeLine{00338\ \ \ \ \ \textcolor{keyword}{auto}\ li\ =\ PyLong\_AsLong(L);}
\DoxyCodeLine{00339\ \ \ \ \ Py\_DECREF(L);}
\DoxyCodeLine{00340\ \ \ \ \ \textcolor{keywordflow}{return}\ li;}
\DoxyCodeLine{00341\ \}}
\DoxyCodeLine{00342\ }
\DoxyCodeLine{00343\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isString()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00344\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00345\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyUnicode\_Check(mPy);}
\DoxyCodeLine{00346\ \}}
\DoxyCodeLine{00347\ }
\DoxyCodeLine{00348\ \textcolor{keyword}{inline}\ std::string\ Object::asString(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00349\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00350\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isString())}
\DoxyCodeLine{00351\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00352\ \ \ \ \ assert(isString());}
\DoxyCodeLine{00353\ \textcolor{preprocessor}{\#if\ PY\_VERSION\_HEX\ >=\ 0x03030000}}
\DoxyCodeLine{00354\ \ \ \ \ \textcolor{keywordflow}{return}\ std::string(PyUnicode\_AsUTF8(mPy));}
\DoxyCodeLine{00355\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00356\ \textcolor{preprocessor}{\#error\ "{}Python\ version\ <\ 3.3\ not\ supported,\ go\ upgrade!"{}}}
\DoxyCodeLine{00357\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00358\ \}}
\DoxyCodeLine{00359\ }
\DoxyCodeLine{00360\ \textcolor{keyword}{inline}\ std::string\ Object::toString()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00361\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00362\ \ \ \ \ \textcolor{keywordflow}{if}\ (!mPy)}
\DoxyCodeLine{00363\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{00364\ \ \ \ \ \textcolor{keywordflow}{if}\ (isString())}
\DoxyCodeLine{00365\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ asString();}
\DoxyCodeLine{00366\ \ \ \ \ \textcolor{keywordflow}{return}\ ObjectRef(PyObject\_Str(mPy))-\/>asString();}
\DoxyCodeLine{00367\ \}}
\DoxyCodeLine{00368\ }
\DoxyCodeLine{00369\ \textcolor{keyword}{inline}\ std::string\_view\ Object::asStringView(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00370\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00371\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isString())}
\DoxyCodeLine{00372\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00373\ \ \ \ \ assert(isString());}
\DoxyCodeLine{00374\ \textcolor{preprocessor}{\#if\ PY\_VERSION\_HEX\ >=\ 0x03030000}}
\DoxyCodeLine{00375\ \ \ \ \ Py\_ssize\_t\ size;}
\DoxyCodeLine{00376\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *ucs\ =\ PyUnicode\_AsUTF8AndSize(mPy,\ \&size);}
\DoxyCodeLine{00377\ \ \ \ \ \textcolor{keywordflow}{return}\ std::string\_view(ucs,\ size);}
\DoxyCodeLine{00378\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00379\ \textcolor{preprocessor}{\#error\ "{}Python\ version\ <\ 3.3\ not\ supported,\ go\ upgrade!"{}}}
\DoxyCodeLine{00380\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00381\ \}}
\DoxyCodeLine{00382\ }
\DoxyCodeLine{00383\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isDict()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00384\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00385\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyDict\_Check(mPy);}
\DoxyCodeLine{00386\ \}}
\DoxyCodeLine{00387\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isList()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00388\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00389\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyList\_Check(mPy);}
\DoxyCodeLine{00390\ \}}
\DoxyCodeLine{00391\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isList(uint\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00392\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00393\ \ \ \ \ \textcolor{keywordflow}{return}\ isList()\ \&\&\ PyList\_Size(mPy)\ ==\ n;}
\DoxyCodeLine{00394\ \}}
\DoxyCodeLine{00395\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::hasListItem(uint\ i)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00396\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00397\ \ \ \ \ \textcolor{keywordflow}{return}\ isList()\ \&\&\ PyList\_Size(mPy)\ >\ i;}
\DoxyCodeLine{00398\ \}}
\DoxyCodeLine{00399\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isTuple()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00400\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00401\ \ \ \ \ \textcolor{keywordflow}{return}\ mPy\ \&\&\ PyTuple\_Check(mPy);}
\DoxyCodeLine{00402\ \}}
\DoxyCodeLine{00403\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isTuple(uint\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00404\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00405\ \ \ \ \ \textcolor{keywordflow}{return}\ isTuple()\ \&\&\ PyTuple\_Size(mPy)\ ==\ n;}
\DoxyCodeLine{00406\ \}}
\DoxyCodeLine{00407\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::hasTupleElem(uint\ i)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00408\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00409\ \ \ \ \ \textcolor{keywordflow}{return}\ isTuple()\ \&\&\ PyTuple\_Size(mPy)\ >\ i;}
\DoxyCodeLine{00410\ \}}
\DoxyCodeLine{00411\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isTupleOrList(uint\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00412\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00413\ \ \ \ \ \textcolor{keywordflow}{return}\ isTuple(n)\ ||\ isList(n);}
\DoxyCodeLine{00414\ \}}
\DoxyCodeLine{00415\ }
\DoxyCodeLine{00416\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ T\ Object::asIntegerContainer()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00417\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00418\ \ \ \ \ \textcolor{keyword}{auto}\ I\ =\ PyObject\_GetIter(mPy);}
\DoxyCodeLine{00419\ \ \ \ \ \textcolor{keywordflow}{if}\ (!I)}
\DoxyCodeLine{00420\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}object\ is\ not\ an\ iterable"{}});}
\DoxyCodeLine{00421\ \ \ \ \ T\ res;}
\DoxyCodeLine{00422\ \ \ \ \ \textcolor{keywordflow}{while}\ (\textcolor{keyword}{auto}\ v\ =\ PyIter\_Next(I))\ \{}
\DoxyCodeLine{00423\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!PyLong\_Check(v))}
\DoxyCodeLine{00424\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}expected\ an\ iterable\ of\ integers"{}});}
\DoxyCodeLine{00425\ \ \ \ \ \ \ \ \ res.insert(res.end(),\ PyLong\_AsLong(v));}
\DoxyCodeLine{00426\ \ \ \ \ \ \ \ \ Py\_DECREF(v);}
\DoxyCodeLine{00427\ \ \ \ \ \}}
\DoxyCodeLine{00428\ \ \ \ \ Py\_DECREF(I);}
\DoxyCodeLine{00429\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00430\ \}}
\DoxyCodeLine{00431\ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ T>\ T\ Object::asStringContainer()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00432\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00433\ \ \ \ \ \textcolor{keyword}{auto}\ I\ =\ PyObject\_GetIter(mPy);}
\DoxyCodeLine{00434\ \ \ \ \ \textcolor{keywordflow}{if}\ (!I)}
\DoxyCodeLine{00435\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}object\ is\ not\ an\ iterable"{}});}
\DoxyCodeLine{00436\ \ \ \ \ T\ res;}
\DoxyCodeLine{00437\ \ \ \ \ \textcolor{keywordflow}{while}\ (\textcolor{keyword}{auto}\ \_v\ =\ PyIter\_Next(I))\ \{}
\DoxyCodeLine{00438\ \ \ \ \ \ \ \ \ Object\ v(\_v);}
\DoxyCodeLine{00439\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!v.isString())}
\DoxyCodeLine{00440\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}expected\ an\ iterable\ of\ strings"{}});}
\DoxyCodeLine{00441\ \ \ \ \ \ \ \ \ res.insert(res.end(),\ v.asString());}
\DoxyCodeLine{00442\ \ \ \ \ \ \ \ \ v.decRef();}
\DoxyCodeLine{00443\ \ \ \ \ \}}
\DoxyCodeLine{00444\ \ \ \ \ Py\_DECREF(I);}
\DoxyCodeLine{00445\ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{00446\ \}}
\DoxyCodeLine{00447\ }
\DoxyCodeLine{00448\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::at(uint\ i)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00449\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00450\ \ \ \ \ \textcolor{keywordflow}{if}\ (isList())}
\DoxyCodeLine{00451\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ item(i);}
\DoxyCodeLine{00452\ \ \ \ \ \textcolor{keywordflow}{if}\ (!isTuple())}
\DoxyCodeLine{00453\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}expected\ a\ list\ or\ tuple"{}});}
\DoxyCodeLine{00454\ \ \ \ \ \textcolor{keywordflow}{return}\ elem(i);}
\DoxyCodeLine{00455\ \}}
\DoxyCodeLine{00456\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::elem(uint\ i,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00457\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00458\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !hasTupleElem(i))}
\DoxyCodeLine{00459\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00460\ \ \ \ \ assert(hasTupleElem(i));}
\DoxyCodeLine{00461\ \ \ \ \ \textcolor{keywordflow}{return}\ PyTuple\_GetItem(mPy,\ i);}
\DoxyCodeLine{00462\ \}}
\DoxyCodeLine{00463\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::item(uint\ i)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00464\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00465\ \ \ \ \ assert(hasListItem(i));}
\DoxyCodeLine{00466\ \ \ \ \ \textcolor{keywordflow}{return}\ PyList\_GetItem(mPy,\ i);}
\DoxyCodeLine{00467\ \}}
\DoxyCodeLine{00468\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ Object::item(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00469\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00470\ \ \ \ \ assert(isDict());}
\DoxyCodeLine{00471\ \ \ \ \ \textcolor{keywordflow}{return}\ PyDict\_GetItemString(mPy,\ name);}
\DoxyCodeLine{00472\ \}}
\DoxyCodeLine{00473\ }
\DoxyCodeLine{00474\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setElem(uint\ i,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ \&v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00475\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00476\ \ \ \ \ setElem(i,\ *v);}
\DoxyCodeLine{00477\ \}}
\DoxyCodeLine{00478\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setElem(uint\ i,\ PyObject\ *v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00479\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00480\ \ \ \ \ assert(hasTupleElem(i));}
\DoxyCodeLine{00481\ \ \ \ \ PyTuple\_SetItem(mPy,\ i,\ v);}
\DoxyCodeLine{00482\ \}}
\DoxyCodeLine{00483\ }
\DoxyCodeLine{00484\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setItem(uint\ i,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ \&v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00485\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00486\ \ \ \ \ setItem(i,\ *v);}
\DoxyCodeLine{00487\ \}}
\DoxyCodeLine{00488\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setItem(uint\ i,\ PyObject\ *v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00489\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00490\ \ \ \ \ assert(hasListItem(i));}
\DoxyCodeLine{00491\ \ \ \ \ PyList\_SetItem(mPy,\ i,\ v);}
\DoxyCodeLine{00492\ \}}
\DoxyCodeLine{00493\ }
\DoxyCodeLine{00494\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ \&v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00495\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00496\ \ \ \ \ setItem(name,\ *v);}
\DoxyCodeLine{00497\ \}}
\DoxyCodeLine{00498\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ PyObject\ *v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00499\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00500\ \ \ \ \ assert(isDict());}
\DoxyCodeLine{00501\ \ \ \ \ assert(v);}
\DoxyCodeLine{00502\ \ \ \ \ PyDict\_SetItemString(mPy,\ name,\ v);}
\DoxyCodeLine{00503\ \ \ \ \ Py\_DECREF(v);}
\DoxyCodeLine{00504\ \}}
\DoxyCodeLine{00505\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::setDictItem(uint\ i,\ PyObject\ *v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00506\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00507\ \ \ \ \ assert(isDict());}
\DoxyCodeLine{00508\ \ \ \ \ PyDict\_SetItem(mPy,\ PyLong\_FromLong(i),\ v);}
\DoxyCodeLine{00509\ \ \ \ \ Py\_DECREF(v);}
\DoxyCodeLine{00510\ \}}
\DoxyCodeLine{00511\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::refItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ PyObject\ *v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00512\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00513\ \ \ \ \ assert(isDict());}
\DoxyCodeLine{00514\ \ \ \ \ PyDict\_SetItemString(mPy,\ name,\ v);}
\DoxyCodeLine{00515\ \}}
\DoxyCodeLine{00516\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Object::refItem(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classpy_1_1Object}{Object}}\ \&v)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00517\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00518\ \ \ \ \ refItem(name,\ *v);}
\DoxyCodeLine{00519\ \}}
\DoxyCodeLine{00520\ }
\DoxyCodeLine{00521\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isVector(uint\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00522\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00523\ \ \ \ \ \textcolor{keywordflow}{if}\ (!isTuple(n))}
\DoxyCodeLine{00524\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00525\ \ \ \ \ \textcolor{keywordflow}{for}\ (uint\ i\ =\ 0;\ i\ <\ n;\ ++i)}
\DoxyCodeLine{00526\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!elem(i).isNumber())}
\DoxyCodeLine{00527\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00528\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00529\ \}}
\DoxyCodeLine{00530\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isLongVector(uint\ n)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00531\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00532\ \ \ \ \ \textcolor{keywordflow}{if}\ (!isTuple(n))}
\DoxyCodeLine{00533\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00534\ \ \ \ \ \textcolor{keywordflow}{for}\ (uint\ i\ =\ 0;\ i\ <\ n;\ ++i)}
\DoxyCodeLine{00535\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!elem(i).isLong())}
\DoxyCodeLine{00536\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00537\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00538\ \}}
\DoxyCodeLine{00539\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Object::isPoint\_25()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00540\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00541\ \ \ \ \ \textcolor{keywordflow}{return}\ isTuple(3)\ \&\&\ elem(0).isNumber()\ \&\&\ elem(1).isNumber()\ \&\&\ elem(2).isLong();}
\DoxyCodeLine{00542\ \}}
\DoxyCodeLine{00543\ }
\DoxyCodeLine{00544\ \textcolor{keyword}{inline}\ IPoint\_2\ Object::asIPoint\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00545\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00546\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isLongVector(2))}
\DoxyCodeLine{00547\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00548\ \ \ \ \ \textcolor{keywordflow}{return}\ IPoint\_2(elem(0).asLong(),\ elem(1).asLong());}
\DoxyCodeLine{00549\ \}}
\DoxyCodeLine{00550\ }
\DoxyCodeLine{00551\ \textcolor{keyword}{inline}\ IPoint\_3\ Object::asIPoint\_3(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00552\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00553\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isLongVector(3))}
\DoxyCodeLine{00554\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00555\ \ \ \ \ \textcolor{keywordflow}{return}\ IPoint\_3(elem(0).asLong(),\ elem(1).asLong(),\ elem(2).asLong());}
\DoxyCodeLine{00556\ \}}
\DoxyCodeLine{00557\ }
\DoxyCodeLine{00558\ \textcolor{keyword}{inline}\ IVector\_2\ Object::asIVector\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00559\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00560\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isLongVector(2))}
\DoxyCodeLine{00561\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00562\ \ \ \ \ \textcolor{keywordflow}{return}\ IVector\_2(elem(0).asLong(),\ elem(1).asLong());}
\DoxyCodeLine{00563\ \}}
\DoxyCodeLine{00564\ }
\DoxyCodeLine{00565\ \textcolor{keyword}{inline}\ IVector\_3\ Object::asIVector\_3(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00566\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00567\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isLongVector(3))}
\DoxyCodeLine{00568\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00569\ \ \ \ \ \textcolor{keywordflow}{return}\ IVector\_3(elem(0).asLong(),\ elem(1).asLong(),\ elem(2).asLong());}
\DoxyCodeLine{00570\ \}}
\DoxyCodeLine{00571\ }
\DoxyCodeLine{00572\ \textcolor{keyword}{inline}\ Vector\_2\ Object::asVector\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00573\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00574\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isVector(2))}
\DoxyCodeLine{00575\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00576\ \ \ \ \ \textcolor{keywordflow}{return}\ Vector\_2(elem(0).toDouble(),\ elem(1).toDouble());}
\DoxyCodeLine{00577\ \}}
\DoxyCodeLine{00578\ }
\DoxyCodeLine{00579\ \textcolor{keyword}{inline}\ Point\_2\ Object::asPoint\_2(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00580\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00581\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isVector(2))}
\DoxyCodeLine{00582\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}object\ is\ not\ a\ 2D\ point"{}});}
\DoxyCodeLine{00583\ \ \ \ \ \textcolor{keywordflow}{return}\ Point\_2(elem(0).toDouble(),\ elem(1).toDouble());}
\DoxyCodeLine{00584\ \}}
\DoxyCodeLine{00585\ }
\DoxyCodeLine{00586\ \textcolor{keyword}{inline}\ Point\_25\ Object::asPoint\_25(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00587\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00588\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !isPoint\_25())}
\DoxyCodeLine{00589\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00590\ \ \ \ \ \textcolor{keywordflow}{return}\ Point\_25(elem(0).toDouble(),\ elem(1).toDouble(),\ elem(2).asLong());}
\DoxyCodeLine{00591\ \}}
\DoxyCodeLine{00592\ }
\DoxyCodeLine{00593\ \textcolor{keyword}{inline}\ uint\ Object::listSize(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *err)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00594\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00595\ \ \ \ \ \textcolor{keywordflow}{if}\ (err\ \&\&\ !PyList\_Check(mPy))}
\DoxyCodeLine{00596\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(err);}
\DoxyCodeLine{00597\ \ \ \ \ \textcolor{keywordflow}{return}\ PyList\_Size(mPy);}
\DoxyCodeLine{00598\ \}}
\DoxyCodeLine{00599\ }
\DoxyCodeLine{00600\ \}\ \textcolor{comment}{//\ namespace\ py}}

\end{DoxyCode}
