\hypertarget{class_qore_1_1_object_iterator}{}\doxysection{Qore\+::Object\+Iterator Class Reference} \label{class_qore_1_1_object_iterator}\index{Qore::ObjectIterator@{Qore::ObjectIterator}} This class a basic iterator class for objects. Inheritance diagram for Qore\+::Object\+Iterator\+: % FIG 0 \doxysubsection*{Public Member Functions} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{class_qore_1_1_object_iterator_a5d7521d37de18a4025aafadfae778eaa}{constructor}} (object o) \begin{DoxyCompactList}\small\item\em Creates the object iterator object. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_object_iterator_a3ffb5335e3efe37ea2d6b93790eda7ef}{constructor}} () \begin{DoxyCompactList}\small\item\em Creates an empty object iterator object. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_object_iterator_af550fe009657cce51c303fd718bf535c}{copy}} () \begin{DoxyCompactList}\small\item\em Creates a copy of the \mbox{\hyperlink{class_qore_1_1_object_iterator}{Object\+Iterator}} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} This class a basic iterator class for objects. Call \mbox{\hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{Object\+Iterator\+::next()}} to iterate through the object; do not use the iterator if \mbox{\hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{Object\+Iterator\+::next()}} returns \mbox{\hyperlink{basic_data_types_False}{False}}. An object can be iterated in reverse order by calling \mbox{\hyperlink{class_qore_1_1_hash_iterator_a9df83a19c89100056c875b2ca40f6ed3}{Object\+Iterator\+::prev()}} instead of \mbox{\hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{Object\+Iterator\+::next()}} \begin{DoxyParagraph}{Example\+: Object\+Iterator basic usage} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{keyword}{class }Class1 \{} \DoxyCodeLine{ public \{} \DoxyCodeLine{ int attr1;} \DoxyCodeLine{ date attr2;} \DoxyCodeLine{ \}} \DoxyCodeLine{ constructor() \{} \DoxyCodeLine{ attr1 = 1;} \DoxyCodeLine{ attr2 = \mbox{\hyperlink{group__date__and__time__functions_ga23f067a4f82596346d4fef09782e1945}{now}}();} \DoxyCodeLine{ \}} \DoxyCodeLine{\}} \DoxyCodeLine{Class1 o();} \DoxyCodeLine{} \DoxyCodeLine{ObjectIterator it(o);} \DoxyCodeLine{\textcolor{keywordflow}{while} (it.next()) \{} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}iter: \%n\(\backslash\)n"{}}, it.getValue());} \DoxyCodeLine{\}} \DoxyCodeLine{} \DoxyCodeLine{iter: 1} \DoxyCodeLine{iter: 2013-\/04-\/17 16:27:28 Wed +02:00 (CEST)} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} \begin{DoxyItemize} \item In general, the \mbox{\hyperlink{class_qore_1_1_object_iterator}{Object\+Iterator}} class is not designed to be accessed from multiple threads; it was created without locking for fast and efficient use when used from a single thread. For methods that would be unsafe to use in another thread, any use of such methods in threads other than the thread where the constructor was called will cause an {\ttfamily ITERATOR-\/\+THREAD-\/\+ERROR} to be thrown. \end{DoxyItemize} \end{DoxyNote} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator}{Object\+Reverse\+Iterator}} \end{DoxySeeAlso} \doxysubsection{Member Function Documentation} \mbox{\Hypertarget{class_qore_1_1_object_iterator_a3ffb5335e3efe37ea2d6b93790eda7ef}\label{class_qore_1_1_object_iterator_a3ffb5335e3efe37ea2d6b93790eda7ef}} \index{Qore::ObjectIterator@{Qore::ObjectIterator}!constructor@{constructor}} \index{constructor@{constructor}!Qore::ObjectIterator@{Qore::ObjectIterator}} \doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily Qore\+::\+Object\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Creates an empty object iterator object. \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*object obj = get\_object\_or\_nothing();} \DoxyCodeLine{ObjectIterator i(obj);} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_object_iterator_a5d7521d37de18a4025aafadfae778eaa}\label{class_qore_1_1_object_iterator_a5d7521d37de18a4025aafadfae778eaa}} \index{Qore::ObjectIterator@{Qore::ObjectIterator}!constructor@{constructor}} \index{constructor@{constructor}!Qore::ObjectIterator@{Qore::ObjectIterator}} \doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily Qore\+::\+Object\+Iterator\+::constructor (\begin{DoxyParamCaption}\item[{object}]{o }\end{DoxyParamCaption})} Creates the object iterator object. \begin{DoxyParams}{Parameters} {\em o} & the object to iterate\\ \hline \end{DoxyParams} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ObjectIterator i(obj);} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_object_iterator_af550fe009657cce51c303fd718bf535c}\label{class_qore_1_1_object_iterator_af550fe009657cce51c303fd718bf535c}} \index{Qore::ObjectIterator@{Qore::ObjectIterator}!copy@{copy}} \index{copy@{copy}!Qore::ObjectIterator@{Qore::ObjectIterator}} \doxysubsubsection{\texorpdfstring{copy()}{copy()}} {\footnotesize\ttfamily Qore\+::\+Object\+Iterator\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Creates a copy of the \mbox{\hyperlink{class_qore_1_1_object_iterator}{Object\+Iterator}} object, iterating the same object as the original and in the same position. \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ObjectIterator ni = i.copy();} \end{DoxyCode} \end{DoxyParagraph}