\hypertarget{class_qore_1_1_hash_list_iterator}{}\doxysection{Qore\+::Hash\+List\+Iterator Class Reference}
\label{class_qore_1_1_hash_list_iterator}\index{Qore::HashListIterator@{Qore::HashListIterator}}


This class an iterator class for hashes of lists as returned by \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a05b1d0d126d815b2d7578e5ce8b9a0de}{Qore\+::\+SQL\+::\+Datasource\+::select()}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_acafe45a0cf883bc51917e7a0bb8e77fd}{Qore\+::\+SQL\+::\+Datasource\+Pool\+::select()}}, both of which return hashes with keys giving column names where the key values are lists of column values.  




Inheritance diagram for Qore\+::Hash\+List\+Iterator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_hash_list_iterator__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a2ecaf9ecfe497e439c5a4cf7075b2d05}{constructor}} (\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ h)
\begin{DoxyCompactList}\small\item\em Creates the hash list iterator object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a49662d291df3753b81c84db73db1261f}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Creates an empty hash list iterator object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_hash_list_iterator_aea2eca1172724d888e732b68adb4758f}{copy}} ()
\begin{DoxyCompactList}\small\item\em Creates a copy of the \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Hash\+List\+Iterator}} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a2613a8ee70fde08923b43a228a44a36e}{empty}} ()
\begin{DoxyCompactList}\small\item\em returns \mbox{\hyperlink{basic_data_types_True}{True}} if the result list is empty; \mbox{\hyperlink{basic_data_types_False}{False}} if not \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_aef0ec0e0df43f4f8f8ba5899a53674d1}{first}} ()
\begin{DoxyCompactList}\small\item\em returns \mbox{\hyperlink{basic_data_types_True}{True}} if on the first element of the list \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_addbc0527f145119b4766f40636deb7fd}{get\+Key\+Value}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} key)
\begin{DoxyCompactList}\small\item\em Returns the current value for the column given as an argument. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a44e8c501275326d8f6769ad29a7ebda3}{get\+Row}} ()
\begin{DoxyCompactList}\small\item\em returns the current row value as a hash or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_ac30588382753a49e3bd1eaac0c6f9918}{get\+Value}} ()
\begin{DoxyCompactList}\small\item\em returns the current row value as a hash or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_adf87382e56f8bc3773ab4319c83e82ea}{index}} ()
\begin{DoxyCompactList}\small\item\em returns the current iterator position in the list or -\/1 if not pointing at a valid element \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a1c2d63097f58f35538bb45138262959b}{last}} ()
\begin{DoxyCompactList}\small\item\em returns \mbox{\hyperlink{basic_data_types_True}{True}} if on the last element of the list \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a4a8b5ac43d799dc662e8a4f85c820b50}{max}} ()
\begin{DoxyCompactList}\small\item\em returns the number of elements in the list \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a216d0595e6098538ff9c48d117f20106}{member\+Gate}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} key)
\begin{DoxyCompactList}\small\item\em This method allows the iterator to be dereferenced directly as a hash for the current row being iterated, as member\+Gate methods are called implicitly when an unknown member is accessed from outside the class. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{next}} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the next element in the result list; returns \mbox{\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 list if the list is not empty. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a6df21aadae44817005795b3b6190874a}{prev}} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the previous element in the result list; returns \mbox{\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 list if the list is not empty. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a26cdde61d96fc4a3d80f793106eb53ad}{reset}} ()
\begin{DoxyCompactList}\small\item\em Reset the iterator instance to its initial state. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_addbd1d1f84da206eb0c86b8ae25119da}{set}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} pos)
\begin{DoxyCompactList}\small\item\em sets the new position in the result list; if the position is invalid then the method returns \mbox{\hyperlink{basic_data_types_False}{False}}, meaning the iterator is not valid, otherwise it returns \mbox{\hyperlink{basic_data_types_True}{True}} \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a9f6eb7c58db7641827e6c9ed12f70b98}{valid}} ()
\begin{DoxyCompactList}\small\item\em returns \mbox{\hyperlink{basic_data_types_True}{True}} if the iterator is currently pointing at a valid element, \mbox{\hyperlink{basic_data_types_False}{False}} if not \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This class an iterator class for hashes of lists as returned by \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_a05b1d0d126d815b2d7578e5ce8b9a0de}{Qore\+::\+SQL\+::\+Datasource\+::select()}} and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_datasource_pool_acafe45a0cf883bc51917e7a0bb8e77fd}{Qore\+::\+SQL\+::\+Datasource\+Pool\+::select()}}, both of which return hashes with keys giving column names where the key values are lists of column values. 

This class can be used as a more flexible alternative to the \mbox{\hyperlink{statements_context}{context statement}}.

Call \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{Hash\+List\+Iterator\+::next()}} to iterate through the lists of column values assigned to each hash key; do not use the iterator if \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{Hash\+List\+Iterator\+::next()}} returns \mbox{\hyperlink{basic_data_types_False}{False}}. A result list can be iterated in reverse order by calling \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a6df21aadae44817005795b3b6190874a}{Hash\+List\+Iterator\+::prev()}} instead of \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{Hash\+List\+Iterator\+::next()}}

\begin{DoxyParagraph}{Example\+: Hash\+List\+Iterator basic usge}

\begin{DoxyCode}{0}
\DoxyCodeLine{hash<auto> data = \{}
\DoxyCodeLine{    \textcolor{stringliteral}{"{}column1"{}}: (1, 2, 3,),}
\DoxyCodeLine{    \textcolor{stringliteral}{"{}column2"{}}: (\textcolor{stringliteral}{"{}a"{}}, \textcolor{stringliteral}{"{}b"{}}, \textcolor{stringliteral}{"{}c"{}},),}
\DoxyCodeLine{    \textcolor{stringliteral}{"{}column3"{}}: \textcolor{stringliteral}{"{}constant"{}},}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{HashListIterator it(data);}
\DoxyCodeLine{\textcolor{keywordflow}{while} (it.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}iter \%d: getValue: \%y; getKeyValue('column1'): \%y\(\backslash\)n"{}},}
\DoxyCodeLine{           it.index(), it.getValue(), it.getKeyValue(\textcolor{stringliteral}{'column1'}));}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{iter 0: getValue: \{column1: 1, column2: \textcolor{stringliteral}{"{}a"{}}, column3: \textcolor{stringliteral}{"{}constant"{}}\}; getKeyValue(\textcolor{stringliteral}{'column1'}): 1}
\DoxyCodeLine{iter 1: getValue: \{column1: 2, column2: \textcolor{stringliteral}{"{}b"{}}, column3: \textcolor{stringliteral}{"{}constant"{}}\}; getKeyValue(\textcolor{stringliteral}{'column1'}): 2}
\DoxyCodeLine{iter 2: getValue: \{column1: 3, column2: \textcolor{stringliteral}{"{}c"{}}, column3: \textcolor{stringliteral}{"{}constant"{}}\}; getKeyValue(\textcolor{stringliteral}{'column1'}): 3}

\end{DoxyCode}

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

\begin{DoxyItemize}
\item A hash with all non-\/list values will be iterated as if each key value were a single element list
\item A hash with mixed lists and single values will have the single values used as the repeating value for every element in the list (as in the above example), however all lists must be of the same size or a runtime exception will be raised
\item A hash with empty lists and constants will not be iterated; in this case the constant values will be ignored; values with lists determine the number of times the data structure will be iterated
\item In general, the \mbox{\hyperlink{class_qore_1_1_hash_list_iterator}{Hash\+List\+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_hash_list_reverse_iterator}{Hash\+List\+Reverse\+Iterator}} 
\end{DoxySeeAlso}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a49662d291df3753b81c84db73db1261f}\label{class_qore_1_1_hash_list_iterator_a49662d291df3753b81c84db73db1261f}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Qore\+::\+Hash\+List\+Iterator\+::constructor (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates an empty hash list iterator object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*hash<auto> q = ds.select(\textcolor{stringliteral}{"{}select * from some\_table"{}});}
\DoxyCodeLine{HashListIterator i(q);}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a2ecaf9ecfe497e439c5a4cf7075b2d05}\label{class_qore_1_1_hash_list_iterator_a2ecaf9ecfe497e439c5a4cf7075b2d05}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+Hash\+List\+Iterator\+::constructor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$}]{h }\end{DoxyParamCaption})}



Creates the hash list iterator object. 


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

\begin{DoxyCode}{0}
\DoxyCodeLine{HashListIterator i(h);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
a hash with non-\/list values will be iterated as if each key value were a single element list 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_aea2eca1172724d888e732b68adb4758f}\label{class_qore_1_1_hash_list_iterator_aea2eca1172724d888e732b68adb4758f}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!copy@{copy}}
\index{copy@{copy}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+Hash\+List\+Iterator\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{HashListIterator ni = i.copy();}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a2613a8ee70fde08923b43a228a44a36e}\label{class_qore_1_1_hash_list_iterator_a2613a8ee70fde08923b43a228a44a36e}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!empty@{empty}}
\index{empty@{empty}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{empty()}{empty()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Iterator\+::empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns \mbox{\hyperlink{basic_data_types_True}{True}} if the result list is empty; \mbox{\hyperlink{basic_data_types_False}{False}} if not 

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if the result list is empty; \mbox{\hyperlink{basic_data_types_False}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (i.empty())}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}the result list is empty\(\backslash\)n"{}});}

\end{DoxyCode}
 
\end{DoxyParagraph}


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

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



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

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if on the first element of the list
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}
 
\end{DoxyParagraph}


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



Reimplemented in \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3dfbb6e8ea42a650bd063403d4efa3be}{Qore\+::\+Hash\+List\+Reverse\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_addbc0527f145119b4766f40636deb7fd}\label{class_qore_1_1_hash_list_iterator_addbc0527f145119b4766f40636deb7fd}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!getKeyValue@{getKeyValue}}
\index{getKeyValue@{getKeyValue}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{getKeyValue()}{getKeyValue()}}
{\footnotesize\ttfamily auto Qore\+::\+Hash\+List\+Iterator\+::get\+Key\+Value (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key }\end{DoxyParamCaption})}



Returns the current value for the column given as an argument. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key} & the column name for the value to retrieve\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the current column value of the given row; the key value returned will be equal to the current list element for the given key, or, if the source key value is a constant (i.\+e. non-\/list) value, then this constant value will be returned directly
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}\%d: value: \%y"{}}, i.index(), i.getKeyValue(\textcolor{stringliteral}{"{}value"{}}));}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\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
{\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element \\
\hline
{\em HASHLISTITERATOR-\/\+ERROR} & the hash key given has a value that is a list with a size that does not match the expected list size\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
\mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a216d0595e6098538ff9c48d117f20106}{Hash\+List\+Iterator\+::member\+Gate()}} allows for the iterator to act as if it is a hash with members equal to the current row being iterated 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a44e8c501275326d8f6769ad29a7ebda3}\label{class_qore_1_1_hash_list_iterator_a44e8c501275326d8f6769ad29a7ebda3}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!getRow@{getRow}}
\index{getRow@{getRow}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{getRow()}{getRow()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+Hash\+List\+Iterator\+::get\+Row (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns the current row value as a hash or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid 

\begin{DoxyReturn}{Returns}
the current row value as a hash or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid; each key value in the hash returned will be equal to the current list element for the element being iterated, or, if the key value in the hash being iterated is a constant (i.\+e. non-\/list) value, then this constant value will be returned as the key value directly
\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{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} + row \%d: \%y\(\backslash\)n"{}}, i.index(), i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
equivalent to \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_ac30588382753a49e3bd1eaac0c6f9918}{Hash\+List\+Iterator\+::get\+Value()}}
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\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
{\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element \\
\hline
{\em HASHLISTITERATOR-\/\+ERROR} & the one of the hash keys has a value that is a list with a size that does not match the expected list size \\
\hline
\end{DoxyExceptions}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_ac30588382753a49e3bd1eaac0c6f9918}\label{class_qore_1_1_hash_list_iterator_ac30588382753a49e3bd1eaac0c6f9918}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!getValue@{getValue}}
\index{getValue@{getValue}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{getValue()}{getValue()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::\+Hash\+List\+Iterator\+::get\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



returns the current row value as a hash or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid 

\begin{DoxyReturn}{Returns}
the current row value as a hash or throws an {\ttfamily INVALID-\/\+ITERATOR} exception if the iterator is invalid; each key value in the hash returned will be equal to the current list element for the element being iterated, or, if the key value in the hash being iterated is a constant (i.\+e. non-\/list) value, then this constant value will be returned as the key value directly
\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{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} + row \%d: \%y\(\backslash\)n"{}}, i.index(), i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}

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

\begin{DoxyItemize}
\item equivalent to \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a44e8c501275326d8f6769ad29a7ebda3}{Hash\+List\+Iterator\+::get\+Row()}}
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\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
{\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element \\
\hline
{\em HASHLISTITERATOR-\/\+ERROR} & the one of the hash keys has a value that is a list with a size that does not match the expected list size \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{class_qore_1_1_abstract_iterator_aa01374b285003faa21b045082063ac12}{Qore\+::\+Abstract\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_adf87382e56f8bc3773ab4319c83e82ea}\label{class_qore_1_1_hash_list_iterator_adf87382e56f8bc3773ab4319c83e82ea}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!index@{index}}
\index{index@{index}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{index()}{index()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Hash\+List\+Iterator\+::index (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns the current iterator position in the list or -\/1 if not pointing at a valid element 

\begin{DoxyReturn}{Returns}
the current iterator position in the list or -\/1 if not pointing at a valid element
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}+ \%d/\%d: \%y\(\backslash\)n"{}}, i.index(), i.max(), i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a1c2d63097f58f35538bb45138262959b}\label{class_qore_1_1_hash_list_iterator_a1c2d63097f58f35538bb45138262959b}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!last@{last}}
\index{last@{last}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{last()}{last()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Iterator\+::last (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



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

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if on the last element of the list
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}
 
\end{DoxyParagraph}


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



Reimplemented in \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_aae133b11d7e847766be7aff7face0fa0}{Qore\+::\+Hash\+List\+Reverse\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a4a8b5ac43d799dc662e8a4f85c820b50}\label{class_qore_1_1_hash_list_iterator_a4a8b5ac43d799dc662e8a4f85c820b50}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!max@{max}}
\index{max@{max}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{max()}{max()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Hash\+List\+Iterator\+::max (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



returns the number of elements in the list 

\begin{DoxyReturn}{Returns}
the number of elements in the list
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}+ \%d/\%d: \%y\(\backslash\)n"{}}, i.index(), i.max(), i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a216d0595e6098538ff9c48d117f20106}\label{class_qore_1_1_hash_list_iterator_a216d0595e6098538ff9c48d117f20106}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!memberGate@{memberGate}}
\index{memberGate@{memberGate}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{memberGate()}{memberGate()}}
{\footnotesize\ttfamily auto Qore\+::\+Hash\+List\+Iterator\+::member\+Gate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{key }\end{DoxyParamCaption})}



This method allows the iterator to be dereferenced directly as a hash for the current row being iterated, as member\+Gate methods are called implicitly when an unknown member is accessed from outside the class. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}}
\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em key} & the column name for the value to retrieve\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the current column value of the given row; the key value returned will be equal to the current list element for the given key, or, if the source key value is a constant (i.\+e. non-\/list) value, then this constant value will be returned directly
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{}\%d: value: \%y"{}}, i.index(), i.value);}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\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
{\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element \\
\hline
{\em HASHLISTITERATOR-\/\+ERROR} & the hash key given has a value that is a list with a size that does not match the expected list size\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
equivalent to \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_addbc0527f145119b4766f40636deb7fd}{Hash\+List\+Iterator\+::get\+Key\+Value()}} when called explicitly 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}\label{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!next@{next}}
\index{next@{next}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{next()}{next()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Iterator\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Moves the current position to the next element in the result list; returns \mbox{\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 list if the list is not empty. 

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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} + row \%d: \%y\(\backslash\)n"{}}, i.index(), i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}

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


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



Reimplemented in \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Qore\+::\+Hash\+List\+Reverse\+Iterator}}.

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



Moves the current position to the previous element in the result list; returns \mbox{\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 list if the list is not empty. 

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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.prev()) \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}}(\textcolor{stringliteral}{"{} + row \%d: \%y\(\backslash\)n"{}}, i.index(), i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}

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


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



Reimplemented in \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a3bc985ec634ecd6d3501ad27e5c1461c}{Qore\+::\+Hash\+List\+Reverse\+Iterator}}.

\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_a26cdde61d96fc4a3d80f793106eb53ad}\label{class_qore_1_1_hash_list_iterator_a26cdde61d96fc4a3d80f793106eb53ad}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!reset@{reset}}
\index{reset@{reset}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{reset()}{reset()}}
{\footnotesize\ttfamily Qore\+::\+Hash\+List\+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}{0}
\DoxyCodeLine{i.reset();}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\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}
\mbox{\Hypertarget{class_qore_1_1_hash_list_iterator_addbd1d1f84da206eb0c86b8ae25119da}\label{class_qore_1_1_hash_list_iterator_addbd1d1f84da206eb0c86b8ae25119da}} 
\index{Qore::HashListIterator@{Qore::HashListIterator}!set@{set}}
\index{set@{set}!Qore::HashListIterator@{Qore::HashListIterator}}
\doxysubsubsection{\texorpdfstring{set()}{set()}}
{\footnotesize\ttfamily bool Qore\+::\+Hash\+List\+Iterator\+::set (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{pos }\end{DoxyParamCaption})}



sets the new position in the result list; if the position is invalid then the method returns \mbox{\hyperlink{basic_data_types_False}{False}}, meaning the iterator is not valid, otherwise it returns \mbox{\hyperlink{basic_data_types_True}{True}} 


\begin{DoxyParams}{Parameters}
{\em pos} & the new position for the iterator with 0 as the first element\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_False}{False}}, meaning the iterator is not valid, otherwise it returns \mbox{\hyperlink{basic_data_types_True}{True}}
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{if} (!i.set(pos))}
\DoxyCodeLine{    throw \textcolor{stringliteral}{"{}INVALID-\/POSITION"{}}, \mbox{\hyperlink{group__string__functions_ga7a74be141f814ef286046c367b21091c}{sprintf}}(\textcolor{stringliteral}{"{}\%d is an invalid position"{}}, pos);}

\end{DoxyCode}

\end{DoxyParagraph}

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



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

\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{basic_data_types_True}{True}} if the iterator is currently pointing at a valid element, \mbox{\hyperlink{basic_data_types_False}{False}} if not
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

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

\end{DoxyCode}
 
\end{DoxyParagraph}


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

