\hypertarget{class_qore_1_1_hash_key_reverse_iterator}{}\section{Qore\+:\+:Hash\+Key\+Reverse\+Iterator Class Reference}
\label{class_qore_1_1_hash_key_reverse_iterator}\index{Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}}


This class an iterator class for hashes.  




Inheritance diagram for Qore\+:\+:Hash\+Key\+Reverse\+Iterator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_hash_key_reverse_iterator__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_qore_1_1_hash_key_reverse_iterator_ac9d414fc40db05031ea1b3621f255ba8}{constructor} (\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ h)
\begin{DoxyCompactList}\small\item\em Creates the hash iterator object. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_hash_key_reverse_iterator_a2f9bdb571778993bba93a6fc48b0d90d}{constructor} ()
\begin{DoxyCompactList}\small\item\em Creates an empty iterator object. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_hash_key_reverse_iterator_a9740114934ef3e6553613f4beee81270}{copy} ()
\begin{DoxyCompactList}\small\item\em Creates a copy of the \hyperlink{class_qore_1_1_hash_key_reverse_iterator}{Hash\+Key\+Reverse\+Iterator} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} \hyperlink{class_qore_1_1_hash_key_reverse_iterator_a2c6cbbc478c54a908faf7766685b4645}{get\+Value} ()
\begin{DoxyCompactList}\small\item\em returns the current key value 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 hashes. 

Call \hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Hash\+Key\+Reverse\+Iterator\+::next()} to iterate through the hash in reverse order; do not use the iterator if \hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Hash\+Key\+Reverse\+Iterator\+::next()} returns \hyperlink{group__boolean__constants_ga9da2b9a8003cd3788e48305f8a00540f}{False}. A hash can be iterated in reverse order by calling \hyperlink{class_qore_1_1_hash_reverse_iterator_a04c6aa78e4bcf4bd7fcd0a0d1964d427}{Hash\+Key\+Reverse\+Iterator\+::prev()} instead of \hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Hash\+Key\+Reverse\+Iterator\+::next()}

\begin{DoxyParagraph}{Example\+: Hash\+Key\+Reverse\+Iterator basic usage}

\begin{DoxyCode}
hash<auto> data = \{
    \textcolor{stringliteral}{"key1"} : 1,
    \textcolor{stringliteral}{"key2"} : 2,
    \textcolor{stringliteral}{"key3"} : 3,
\};

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

iter: \textcolor{stringliteral}{"key3"}
iter: \textcolor{stringliteral}{"key2"}
iter: \textcolor{stringliteral}{"key1"}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item In general, the \hyperlink{class_qore_1_1_hash_key_reverse_iterator}{Hash\+Key\+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 \hyperlink{class_qore_1_1_hash_key_reverse_iterator}{Hash\+Key\+Reverse\+Iterator} is functionally equivalent to \hyperlink{class_qore_1_1_hash_key_iterator}{Hash\+Key\+Iterator}, but the effect of \hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Hash\+Key\+Reverse\+Iterator\+::next()} and \hyperlink{class_qore_1_1_hash_reverse_iterator_a04c6aa78e4bcf4bd7fcd0a0d1964d427}{Hash\+Key\+Reverse\+Iterator\+::prev()} are the opposite of \hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{Hash\+Key\+Iterator\+::next()} and \hyperlink{class_qore_1_1_hash_iterator_a9df83a19c89100056c875b2ca40f6ed3}{Hash\+Key\+Iterator\+::prev()}; that is \hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Hash\+Key\+Reverse\+Iterator\+::next()} will iterate through the hash in reverse order, while \hyperlink{class_qore_1_1_hash_reverse_iterator_a04c6aa78e4bcf4bd7fcd0a0d1964d427}{Hash\+Key\+Reverse\+Iterator\+::prev()} iterates in forward order. Additionally the meanings of the return values for \hyperlink{class_qore_1_1_hash_reverse_iterator_ac7cf3e0eda0c8f4854e3dd6fab31a1ab}{Hash\+Key\+Reverse\+Iterator\+::first()} and \hyperlink{class_qore_1_1_hash_reverse_iterator_aec930a3efe298b98eeda8670c132dd8f}{Hash\+Key\+Reverse\+Iterator\+::last()} are swapped in respect to \hyperlink{class_qore_1_1_hash_iterator_a1d639332a9f27f97a830994b1a68ada2}{Hash\+Key\+Iterator\+::first()} and \hyperlink{class_qore_1_1_hash_iterator_a40b7935be4791e186dba782e091084e5}{Hash\+Key\+Iterator\+::last()}.
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_hash_key_iterator}{Hash\+Key\+Iterator} 
\end{DoxySeeAlso}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_hash_key_reverse_iterator_ac9d414fc40db05031ea1b3621f255ba8}\label{class_qore_1_1_hash_key_reverse_iterator_ac9d414fc40db05031ea1b3621f255ba8}} 
\index{Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Qore\+::\+Hash\+Key\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}\item[{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$}]{h }\end{DoxyParamCaption})}



Creates the hash iterator object. 


\begin{DoxyParams}{Parameters}
{\em h} & the hash to iterate\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
HashKeyReverseIterator hi(h);
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_key_reverse_iterator_a2f9bdb571778993bba93a6fc48b0d90d}\label{class_qore_1_1_hash_key_reverse_iterator_a2f9bdb571778993bba93a6fc48b0d90d}} 
\index{Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+Hash\+Key\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates an empty iterator object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
*hash<auto> h = get\_hash\_or\_nothing();
HashKeyReverseIterator hi(h);
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_key_reverse_iterator_a9740114934ef3e6553613f4beee81270}\label{class_qore_1_1_hash_key_reverse_iterator_a9740114934ef3e6553613f4beee81270}} 
\index{Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}!copy@{copy}}
\index{copy@{copy}!Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+Hash\+Key\+Reverse\+Iterator\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates a copy of the \hyperlink{class_qore_1_1_hash_key_reverse_iterator}{Hash\+Key\+Reverse\+Iterator} object, iterating the same object as the original and in the same position. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
HashKeyReverseIterator ni = i.copy();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_key_reverse_iterator_a2c6cbbc478c54a908faf7766685b4645}\label{class_qore_1_1_hash_key_reverse_iterator_a2c6cbbc478c54a908faf7766685b4645}} 
\index{Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}!get\+Value@{get\+Value}}
\index{get\+Value@{get\+Value}!Qore\+::\+Hash\+Key\+Reverse\+Iterator@{Qore\+::\+Hash\+Key\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{get\+Value()}{getValue()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} Qore\+::\+Hash\+Key\+Reverse\+Iterator\+::get\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns the current key value 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}
the current key value 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\+:}
\hyperlink{code_flags_RET_VALUE_ONLY}{R\+E\+T\+\_\+\+V\+A\+L\+U\+E\+\_\+\+O\+N\+LY}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
HashKeyReverseIterator hi(hash);
\textcolor{keywordflow}{while} (hi.next())
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"key: %s\(\backslash\)n"}, hi.getValue());
\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}


Reimplemented from \hyperlink{class_qore_1_1_hash_iterator_ac476d576e747b685d4284fb02a5cf83e}{Qore\+::\+Hash\+Iterator}.

