\hypertarget{class_qore_1_1_hash_iterator}{}\section{Qore\+:\+:Hash\+Iterator Class Reference}
\label{class_qore_1_1_hash_iterator}\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}


This class an iterator class for hashes.  




Inheritance diagram for Qore\+:\+:Hash\+Iterator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_hash_iterator__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_qore_1_1_hash_iterator_a842d257239bb77f2989960dbe1ddabc9}{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_iterator_a1fc56abc6eb066009a390ff11fe5b69d}{constructor} ()
\begin{DoxyCompactList}\small\item\em Creates an empty hash iterator object. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_hash_iterator_ae35efa6b6afd35bc56fdddd9d5622059}{copy} ()
\begin{DoxyCompactList}\small\item\em Creates a copy of the \hyperlink{class_qore_1_1_hash_iterator}{Hash\+Iterator} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_hash_iterator_adc2400ed775808e5ab8a3afd671c4428}{empty} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if the hash is empty; \hyperlink{basic_data_types_False}{False} if not \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_hash_iterator_a1d639332a9f27f97a830994b1a68ada2}{first} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if on the first element of the hash \end{DoxyCompactList}\item 
\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} \hyperlink{class_qore_1_1_hash_iterator_a60c35d8ea159a1f9b53c0b164094c7c0}{get\+Key} ()
\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}\item 
auto \hyperlink{class_qore_1_1_hash_iterator_a0d62ed2e642f1f9f0fc06cbd2d79b14b}{get\+Key\+Value} ()
\begin{DoxyCompactList}\small\item\em returns the current value of the current hash key being iterated 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}\item 
auto \hyperlink{class_qore_1_1_hash_iterator_ac476d576e747b685d4284fb02a5cf83e}{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}\item 
\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$ auto $>$ \hyperlink{class_qore_1_1_hash_iterator_a1300d0cec84d5f08b89fdc3d18f1f229}{get\+Value\+Pair} ()
\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}\item 
bool \hyperlink{class_qore_1_1_hash_iterator_a40b7935be4791e186dba782e091084e5}{last} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if on the last element of the hash \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{next} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the next element in the hash; returns \hyperlink{basic_data_types_False}{False} if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the first element in the hash if the hash is not empty. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_hash_iterator_a9df83a19c89100056c875b2ca40f6ed3}{prev} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the previous element in the hash; returns \hyperlink{basic_data_types_False}{False} if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the last element in the hash if the hash is not empty. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_hash_iterator_ad7b5c2e35ee739f1ef3cbe9565f075ad}{reset} ()
\begin{DoxyCompactList}\small\item\em Reset the iterator instance to its initial state. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_hash_iterator_a12d469ed0e4ba8b61b8a38fa97332ef1}{valid} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if the iterator is currently pointing at a valid element, \hyperlink{basic_data_types_False}{False} if not \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class an iterator class for hashes. 

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

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

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

HashIterator it(h);
\textcolor{keywordflow}{while} (it.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"getKey: %n; getKeyValue: %n; getValue: %n; getValuePair: %n\(\backslash\)n"},
           it.getKey(), it.getKeyValue(), it.getValue(), it.getValuePair());
\}

getKey: \textcolor{stringliteral}{"key1"}; getKeyValue: 1; getValue: 1; getValuePair: hash: (key : \textcolor{stringliteral}{"key1"}, value : 1)
getKey: \textcolor{stringliteral}{"key2"}; getKeyValue: 2; getValue: 2; getValuePair: hash: (key : \textcolor{stringliteral}{"key2"}, value : 2)
\end{DoxyCode}

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

\begin{DoxyItemize}
\item In general, the \hyperlink{class_qore_1_1_hash_iterator}{Hash\+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.
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_hash_reverse_iterator}{Hash\+Reverse\+Iterator} 
\end{DoxySeeAlso}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a842d257239bb77f2989960dbe1ddabc9}\label{class_qore_1_1_hash_iterator_a842d257239bb77f2989960dbe1ddabc9}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Qore\+::\+Hash\+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}
HashIterator hi(h);
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a1fc56abc6eb066009a390ff11fe5b69d}\label{class_qore_1_1_hash_iterator_a1fc56abc6eb066009a390ff11fe5b69d}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+Hash\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates an empty hash iterator object. 

\begin{DoxyParagraph}{Example\+:}

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



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

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
HashIterator ni = i.copy();
\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_adc2400ed775808e5ab8a3afd671c4428}\label{class_qore_1_1_hash_iterator_adc2400ed775808e5ab8a3afd671c4428}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!empty@{empty}}
\index{empty@{empty}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{empty()}{empty()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+Iterator\+::empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns \hyperlink{basic_data_types_True}{True} if the hash is empty; \hyperlink{basic_data_types_False}{False} if not 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if the hash is empty; \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{if} (i.empty())
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"the hash is empty\(\backslash\)n"});
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_abstract_quantified_iterator_aa859f2f4a719f955b100cde8b65b3277}{Qore\+::\+Abstract\+Quantified\+Iterator}.

\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a1d639332a9f27f97a830994b1a68ada2}\label{class_qore_1_1_hash_iterator_a1d639332a9f27f97a830994b1a68ada2}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!first@{first}}
\index{first@{first}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{first()}{first()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+Iterator\+::first (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns \hyperlink{basic_data_types_True}{True} if on the first element of the hash 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if on the first element of the hash
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \textcolor{keywordflow}{if} (i.first())
        \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"START:\(\backslash\)n"});
\}
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_abstract_quantified_iterator_a4264e42010fa08a8099692e2876c3241}{Qore\+::\+Abstract\+Quantified\+Iterator}.



Reimplemented in \hyperlink{class_qore_1_1_object_reverse_iterator_a6f053540cbbc574c438e6201b713f7dd}{Qore\+::\+Object\+Reverse\+Iterator}, and \hyperlink{class_qore_1_1_hash_reverse_iterator_ac7cf3e0eda0c8f4854e3dd6fab31a1ab}{Qore\+::\+Hash\+Reverse\+Iterator}.

\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a60c35d8ea159a1f9b53c0b164094c7c0}\label{class_qore_1_1_hash_iterator_a60c35d8ea159a1f9b53c0b164094c7c0}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!get\+Key@{get\+Key}}
\index{get\+Key@{get\+Key}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{get\+Key()}{getKey()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string} Qore\+::\+Hash\+Iterator\+::get\+Key (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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}
\textcolor{keywordflow}{while} (i.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"+ %y\(\backslash\)n"}, i.getKey());
\}
\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}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a0d62ed2e642f1f9f0fc06cbd2d79b14b}\label{class_qore_1_1_hash_iterator_a0d62ed2e642f1f9f0fc06cbd2d79b14b}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!get\+Key\+Value@{get\+Key\+Value}}
\index{get\+Key\+Value@{get\+Key\+Value}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{get\+Key\+Value()}{getKeyValue()}}
{\footnotesize\ttfamily auto Qore\+::\+Hash\+Iterator\+::get\+Key\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns the current value of the current hash key being iterated 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 value of the current hash key being iterated 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}
\textcolor{keywordflow}{while} (i.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"+ %y\(\backslash\)n"}, i.getKeyValue());
\}
\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 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_ac476d576e747b685d4284fb02a5cf83e}\label{class_qore_1_1_hash_iterator_ac476d576e747b685d4284fb02a5cf83e}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!get\+Value@{get\+Value}}
\index{get\+Value@{get\+Value}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{get\+Value()}{getValue()}}
{\footnotesize\ttfamily auto Qore\+::\+Hash\+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 

The current hash key can be returned with \hyperlink{class_qore_1_1_hash_iterator_a60c35d8ea159a1f9b53c0b164094c7c0}{get\+Key()}.

\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}
\textcolor{keywordflow}{while} (i.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"+ %y\(\backslash\)n"}, i.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}


Implements \hyperlink{class_qore_1_1_abstract_iterator_a1f7b94aa7237f59c4f959f4d33333d9a}{Qore\+::\+Abstract\+Iterator}.



Reimplemented in \hyperlink{class_qore_1_1_object_pair_reverse_iterator_aedf5e1075159bbf2f43dc20f56a18c80}{Qore\+::\+Object\+Pair\+Reverse\+Iterator}, \hyperlink{class_qore_1_1_object_key_reverse_iterator_a3434e0503dad1fd3f569ae330036f573}{Qore\+::\+Object\+Key\+Reverse\+Iterator}, \hyperlink{class_qore_1_1_hash_key_reverse_iterator_a2c6cbbc478c54a908faf7766685b4645}{Qore\+::\+Hash\+Key\+Reverse\+Iterator}, \hyperlink{class_qore_1_1_hash_pair_reverse_iterator_a90f26825378858c2020954104ab5bb1b}{Qore\+::\+Hash\+Pair\+Reverse\+Iterator}, \hyperlink{class_qore_1_1_object_pair_iterator_a6f3fd6f1cd8d7d8d1d5909593acf048a}{Qore\+::\+Object\+Pair\+Iterator}, \hyperlink{class_qore_1_1_object_key_iterator_a7b936b687c054fda6f93b76ed04d5292}{Qore\+::\+Object\+Key\+Iterator}, \hyperlink{class_qore_1_1_hash_pair_iterator_a7fbbc6dd431b481042d49eeb706b871e}{Qore\+::\+Hash\+Pair\+Iterator}, and \hyperlink{class_qore_1_1_hash_key_iterator_a749d9db18178ea1f86aa721b3c37a770}{Qore\+::\+Hash\+Key\+Iterator}.

\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a1300d0cec84d5f08b89fdc3d18f1f229}\label{class_qore_1_1_hash_iterator_a1300d0cec84d5f08b89fdc3d18f1f229}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!get\+Value\+Pair@{get\+Value\+Pair}}
\index{get\+Value\+Pair@{get\+Value\+Pair}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{get\+Value\+Pair()}{getValuePair()}}
{\footnotesize\ttfamily \hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}$<$auto$>$ Qore\+::\+Hash\+Iterator\+::get\+Value\+Pair (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"+ %y\(\backslash\)n"}, i.getValuePair());
\}
\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 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a40b7935be4791e186dba782e091084e5}\label{class_qore_1_1_hash_iterator_a40b7935be4791e186dba782e091084e5}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!last@{last}}
\index{last@{last}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{last()}{last()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+Iterator\+::last (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns \hyperlink{basic_data_types_True}{True} if on the last element of the hash 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if on the last element of the hash
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \textcolor{keywordflow}{if} (i.last())
        \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"END.\(\backslash\)n"});
\}
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_abstract_quantified_iterator_aa7bef0cd843ced4319fd5f0d7647ef8e}{Qore\+::\+Abstract\+Quantified\+Iterator}.



Reimplemented in \hyperlink{class_qore_1_1_object_reverse_iterator_a96a5d6b421ccbe6875ca2f3fbfe7576d}{Qore\+::\+Object\+Reverse\+Iterator}, and \hyperlink{class_qore_1_1_hash_reverse_iterator_aec930a3efe298b98eeda8670c132dd8f}{Qore\+::\+Hash\+Reverse\+Iterator}.

\mbox{\Hypertarget{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}\label{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!next@{next}}
\index{next@{next}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{next()}{next()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+Iterator\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Moves the current position to the next element in the hash; returns \hyperlink{basic_data_types_False}{False} if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the first element in the hash if the hash is not empty. 

This method will return \hyperlink{basic_data_types_True}{True} again after it returns \hyperlink{basic_data_types_False}{False} once if hash is not empty, otherwise it will always return \hyperlink{basic_data_types_False}{False}. The iterator object should not be used after this method returns \hyperlink{basic_data_types_False}{False}

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_False}{False} if there are no more elements in the hash (in which case the iterator object is invalid and should not be used); \hyperlink{basic_data_types_True}{True} if successful (meaning that the iterator object is valid)
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{" + %y = %y\(\backslash\)n"}, i.getKey(), i.getValue());
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\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}


Implements \hyperlink{class_qore_1_1_abstract_iterator_ab10d5694cc2fcd3b6689ea7494da79de}{Qore\+::\+Abstract\+Iterator}.



Reimplemented in \hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Qore\+::\+Object\+Reverse\+Iterator}, and \hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Qore\+::\+Hash\+Reverse\+Iterator}.

\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a9df83a19c89100056c875b2ca40f6ed3}\label{class_qore_1_1_hash_iterator_a9df83a19c89100056c875b2ca40f6ed3}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!prev@{prev}}
\index{prev@{prev}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{prev()}{prev()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+Iterator\+::prev (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Moves the current position to the previous element in the hash; returns \hyperlink{basic_data_types_False}{False} if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the last element in the hash if the hash is not empty. 

This method will return \hyperlink{basic_data_types_True}{True} again after it returns \hyperlink{basic_data_types_False}{False} once if the hash is not empty, otherwise it will always return \hyperlink{basic_data_types_False}{False}. The iterator object should not be used after this method returns \hyperlink{basic_data_types_False}{False}

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_False}{False} if there are no more elements in the hash (in which case the iterator object is invalid and should not be used); \hyperlink{basic_data_types_True}{True} if successful (meaning that the iterator object is valid)
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{while} (i.prev()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{" + %y = %y\(\backslash\)n"}, i.getKey(), i.getValue());
\}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\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}


Implements \hyperlink{class_qore_1_1_abstract_bidirectional_iterator_a8ca43ac8bffc78178f61e3cca9b6323e}{Qore\+::\+Abstract\+Bidirectional\+Iterator}.



Reimplemented in \hyperlink{class_qore_1_1_object_reverse_iterator_a8eb6d967f85d306e897e08deadd63c92}{Qore\+::\+Object\+Reverse\+Iterator}, and \hyperlink{class_qore_1_1_hash_reverse_iterator_a04c6aa78e4bcf4bd7fcd0a0d1964d427}{Qore\+::\+Hash\+Reverse\+Iterator}.

\mbox{\Hypertarget{class_qore_1_1_hash_iterator_ad7b5c2e35ee739f1ef3cbe9565f075ad}\label{class_qore_1_1_hash_iterator_ad7b5c2e35ee739f1ef3cbe9565f075ad}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!reset@{reset}}
\index{reset@{reset}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{reset()}{reset()}}
{\footnotesize\ttfamily Qore\+::\+Hash\+Iterator\+::reset (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reset the iterator instance to its initial state. 

Reset the iterator instance to its initial state

\begin{DoxyParagraph}{Example}

\begin{DoxyCode}
i.reset();
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\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}
\mbox{\Hypertarget{class_qore_1_1_hash_iterator_a12d469ed0e4ba8b61b8a38fa97332ef1}\label{class_qore_1_1_hash_iterator_a12d469ed0e4ba8b61b8a38fa97332ef1}} 
\index{Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}!valid@{valid}}
\index{valid@{valid}!Qore\+::\+Hash\+Iterator@{Qore\+::\+Hash\+Iterator}}
\subsubsection{\texorpdfstring{valid()}{valid()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+Iterator\+::valid (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns \hyperlink{basic_data_types_True}{True} if the iterator is currently pointing at a valid element, \hyperlink{basic_data_types_False}{False} if not 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if the iterator is currently pointing at a valid element, \hyperlink{basic_data_types_False}{False} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\hyperlink{code_flags_CONSTANT}{C\+O\+N\+S\+T\+A\+NT}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}
\textcolor{keywordflow}{if} (i.valid())
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"current value: %y\(\backslash\)n"}, i.getValue());
\end{DoxyCode}
 
\end{DoxyParagraph}


Implements \hyperlink{class_qore_1_1_abstract_iterator_aee1def5d872b487b8917a166d9b263e8}{Qore\+::\+Abstract\+Iterator}.

