\hypertarget{class_qore_1_1_object_pair_reverse_iterator}{}\doxysection{Qore\+::Object\+Pair\+Reverse\+Iterator Class Reference} \label{class_qore_1_1_object_pair_reverse_iterator}\index{Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}} This class an iterator class for objects. Inheritance diagram for Qore\+::Object\+Pair\+Reverse\+Iterator\+: % FIG 0 \doxysubsection*{Public Member Functions} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator_a1621e2b22501ddaf4b5520d87946fc8a}{constructor}} (object o) \begin{DoxyCompactList}\small\item\em Creates the object iterator object. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator_ac65165379ca967f0ca0037a9922c6fb2}{constructor}} () \begin{DoxyCompactList}\small\item\em Creates an empty iterator object. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator_a4691d8cf1ccc290bfd0ebba20ff3d5fd}{copy}} () \begin{DoxyCompactList}\small\item\em Creates a copy of the \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator}{Object\+Pair\+Reverse\+Iterator}} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator_aedf5e1075159bbf2f43dc20f56a18c80}{get\+Value}} () \begin{DoxyCompactList}\small\item\em returns a hash with the current key and value (a hash with 2 keys\+: {\ttfamily \char`\"{}key\char`\"{}} and {\ttfamily \char`\"{}value\char`\"{}}) or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} This class an iterator class for objects. Call \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Object\+Pair\+Reverse\+Iterator\+::next()}} to iterate through the object in reverse order; do not use the iterator if \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Object\+Pair\+Reverse\+Iterator\+::next()}} returns \mbox{\hyperlink{basic_data_types_False}{False}}. A object can be iterated in reverse order by calling \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a8eb6d967f85d306e897e08deadd63c92}{Object\+Pair\+Reverse\+Iterator\+::prev()}} instead of \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Object\+Pair\+Reverse\+Iterator\+::next()}} \begin{DoxyParagraph}{Example\+: Object\+Pair\+Reverse\+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{ObjectPairReverseIterator 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: hash: (key : \textcolor{stringliteral}{"{}attr2"{}}, value : 2013-\/04-\/17 16:38:31 Wed +02:00 (CEST))} \DoxyCodeLine{iter: hash: (key : \textcolor{stringliteral}{"{}attr1"{}}, value : 1)} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} \begin{DoxyItemize} \item In general, the \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator}{Object\+Pair\+Reverse\+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. \item \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator}{Object\+Pair\+Reverse\+Iterator}} is functionally equivalent to \mbox{\hyperlink{class_qore_1_1_object_pair_iterator}{Object\+Pair\+Iterator}}, but the effect of \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Object\+Pair\+Reverse\+Iterator\+::next()}} and \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a8eb6d967f85d306e897e08deadd63c92}{Object\+Pair\+Reverse\+Iterator\+::prev()}} are the opposite of \mbox{\hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{Object\+Pair\+Iterator\+::next()}} and \mbox{\hyperlink{class_qore_1_1_hash_iterator_a9df83a19c89100056c875b2ca40f6ed3}{Object\+Pair\+Iterator\+::prev()}}; that is \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Object\+Pair\+Reverse\+Iterator\+::next()}} will iterate through the object in reverse order, while \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a8eb6d967f85d306e897e08deadd63c92}{Object\+Pair\+Reverse\+Iterator\+::prev()}} iterates in forward order. Additionally the meanings of the return values for \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a6f053540cbbc574c438e6201b713f7dd}{Object\+Pair\+Reverse\+Iterator\+::first()}} and \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a96a5d6b421ccbe6875ca2f3fbfe7576d}{Object\+Pair\+Reverse\+Iterator\+::last()}} are swapped in respect to \mbox{\hyperlink{class_qore_1_1_hash_iterator_a1d639332a9f27f97a830994b1a68ada2}{Object\+Pair\+Iterator\+::first()}} and \mbox{\hyperlink{class_qore_1_1_hash_iterator_a40b7935be4791e186dba782e091084e5}{Object\+Pair\+Iterator\+::last()}}. \end{DoxyItemize} \end{DoxyNote} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{class_qore_1_1_object_pair_iterator}{Object\+Pair\+Iterator}} \end{DoxySeeAlso} \doxysubsection{Member Function Documentation} \mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_ac65165379ca967f0ca0037a9922c6fb2}\label{class_qore_1_1_object_pair_reverse_iterator_ac65165379ca967f0ca0037a9922c6fb2}} \index{Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}!constructor@{constructor}} \index{constructor@{constructor}!Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}} \doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}} {\footnotesize\ttfamily Qore\+::\+Object\+Pair\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Creates an empty iterator object. \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{*object obj = get\_object\_or\_nothing();} \DoxyCodeLine{ObjectPairReverseIterator i(obj);} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_a1621e2b22501ddaf4b5520d87946fc8a}\label{class_qore_1_1_object_pair_reverse_iterator_a1621e2b22501ddaf4b5520d87946fc8a}} \index{Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}!constructor@{constructor}} \index{constructor@{constructor}!Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}} \doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}} {\footnotesize\ttfamily Qore\+::\+Object\+Pair\+Reverse\+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{ObjectPairReverseIterator i(obj);} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_a4691d8cf1ccc290bfd0ebba20ff3d5fd}\label{class_qore_1_1_object_pair_reverse_iterator_a4691d8cf1ccc290bfd0ebba20ff3d5fd}} \index{Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}!copy@{copy}} \index{copy@{copy}!Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}} \doxysubsubsection{\texorpdfstring{copy()}{copy()}} {\footnotesize\ttfamily Qore\+::\+Object\+Pair\+Reverse\+Iterator\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Creates a copy of the \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator}{Object\+Pair\+Reverse\+Iterator}} object, iterating the same object as the original and in the same position. \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{ObjectPairReverseIterator ni = i.copy();} \end{DoxyCode} \end{DoxyParagraph} \mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_aedf5e1075159bbf2f43dc20f56a18c80}\label{class_qore_1_1_object_pair_reverse_iterator_aedf5e1075159bbf2f43dc20f56a18c80}} \index{Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}!getValue@{getValue}} \index{getValue@{getValue}!Qore::ObjectPairReverseIterator@{Qore::ObjectPairReverseIterator}} \doxysubsubsection{\texorpdfstring{getValue()}{getValue()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+Object\+Pair\+Reverse\+Iterator\+::get\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}} returns a hash with the current key and value (a hash with 2 keys\+: {\ttfamily \char`\"{}key\char`\"{}} and {\ttfamily \char`\"{}value\char`\"{}}) or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid \begin{DoxyReturn}{Returns} a hash with the current key and value (a hash with 2 keys\+: {\ttfamily \char`\"{}key\char`\"{}} and {\ttfamily \char`\"{}value\char`\"{}}) or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid \end{DoxyReturn} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{foreach hash h \textcolor{keywordflow}{in} (new ObjectPairReverseIterator(obj))} \DoxyCodeLine{ \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}\%s: \%y\(\backslash\)n"{}}, h.key, h.value);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element \\ \hline {\em ITERATOR-\/\+THREAD-\/\+ERROR} & this exception is thrown if this method is called from any thread other than the thread that created the object\\ \hline \end{DoxyExceptions} \begin{DoxySince}{Since} Qore 0.\+8.\+6.\+2 \end{DoxySince} Reimplemented from \mbox{\hyperlink{class_qore_1_1_hash_iterator_ac476d576e747b685d4284fb02a5cf83e}{Qore\+::\+Hash\+Iterator}}.