\hypertarget{class_qore_1_1_object_pair_reverse_iterator}{}\section{Qore\+:\+:Object\+Pair\+Reverse\+Iterator Class Reference}
\label{class_qore_1_1_object_pair_reverse_iterator}\index{Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}}


This class an iterator class for objects.  




Inheritance diagram for Qore\+:\+:Object\+Pair\+Reverse\+Iterator\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_object_pair_reverse_iterator__inherit__graph}
\end{center}
\end{figure}
\subsection*{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_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator_a9313e089ca5eedb041855cce13ab6c8e}{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 I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} exception if the iterator is invalid \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{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{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{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}
\textcolor{keyword}{class }Class1 \{
   public \{
      int attr1;
      date attr2;
   \}
   constructor() \{
      attr1 = 1;
      attr2 = \mbox{\hyperlink{group__date__and__time__functions_ga23f067a4f82596346d4fef09782e1945}{now}}();
   \}
\}
Class1 o();

ObjectPairReverseIterator it(o);
\textcolor{keywordflow}{while} (it.next()) \{
    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"iter: %n\(\backslash\)n"}, it.getValue());
\}

iter: hash: (key : \textcolor{stringliteral}{"attr2"}, value : 2013-04-17 16:38:31 Wed +02:00 (CEST))
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 I\+T\+E\+R\+A\+T\+O\+R-\/\+T\+H\+R\+E\+A\+D-\/\+E\+R\+R\+OR} 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}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_a1621e2b22501ddaf4b5520d87946fc8a}\label{class_qore_1_1_object_pair_reverse_iterator_a1621e2b22501ddaf4b5520d87946fc8a}} 
\index{Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/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}
ObjectPairReverseIterator i(obj);
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_ac65165379ca967f0ca0037a9922c6fb2}\label{class_qore_1_1_object_pair_reverse_iterator_ac65165379ca967f0ca0037a9922c6fb2}} 
\index{Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+Object\+Pair\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates an empty iterator object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*object obj = get\_object\_or\_nothing();
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\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}!copy@{copy}}
\index{copy@{copy}!Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}}
\subsubsection{\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}
ObjectPairReverseIterator ni = i.copy();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_object_pair_reverse_iterator_a9313e089ca5eedb041855cce13ab6c8e}\label{class_qore_1_1_object_pair_reverse_iterator_a9313e089ca5eedb041855cce13ab6c8e}} 
\index{Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}!get\+Value@{get\+Value}}
\index{get\+Value@{get\+Value}!Qore\+::\+Object\+Pair\+Reverse\+Iterator@{Qore\+::\+Object\+Pair\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{get\+Value()}{getValue()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} 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 I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} 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 I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} exception if the iterator is invalid
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
foreach hash h \textcolor{keywordflow}{in} (new ObjectPairReverseIterator(obj))
    \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 I\+N\+V\+A\+L\+I\+D-\/\+I\+T\+E\+R\+A\+T\+OR} & the iterator is not pointing at a valid element \\
\hline
{\em I\+T\+E\+R\+A\+T\+O\+R-\/\+T\+H\+R\+E\+A\+D-\/\+E\+R\+R\+OR} & 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}}.

