\hypertarget{class_qore_1_1_abstract_iterator}{}\doxysection{Qore\+::Abstract\+Iterator Class Reference}
\label{class_qore_1_1_abstract_iterator}\index{Qore::AbstractIterator@{Qore::AbstractIterator}}


This class defines an abstract interface for iterators.  




{\ttfamily \#include $<$QC\+\_\+\+Abstract\+Iterator.\+dox.\+h$>$}



Inheritance diagram for Qore\+::Abstract\+Iterator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_abstract_iterator__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
abstract auto \mbox{\hyperlink{class_qore_1_1_abstract_iterator_aa01374b285003faa21b045082063ac12}{get\+Value}} ()
\begin{DoxyCompactList}\small\item\em returns the current value \end{DoxyCompactList}\item 
abstract bool \mbox{\hyperlink{class_qore_1_1_abstract_iterator_ab10d5694cc2fcd3b6689ea7494da79de}{next}} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the next element; returns \mbox{\hyperlink{basic_data_types_False}{False}} if there are no more elements. \end{DoxyCompactList}\item 
abstract bool \mbox{\hyperlink{class_qore_1_1_abstract_iterator_aee1def5d872b487b8917a166d9b263e8}{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 defines an abstract interface for iterators. 

Classes inheriting this class can be used to iterate abstract or complex objects with \mbox{\hyperlink{statements_while}{while Statements}} (using \mbox{\hyperlink{class_qore_1_1_abstract_iterator_ab10d5694cc2fcd3b6689ea7494da79de}{Abstract\+Iterator\+::next()}}) or directly in the following language constructs\+:
\begin{DoxyItemize}
\item \mbox{\hyperlink{operators_map}{Map Operator (map)}}
\item \mbox{\hyperlink{operators_foldr}{Fold Right Operator (foldr)}} and \mbox{\hyperlink{operators_foldl}{Fold Left Operator (foldl)}}
\item \mbox{\hyperlink{operators_select}{Select From List Operator (select)}}
\item \mbox{\hyperlink{statements_foreach}{foreach Statements}} 
\end{DoxyItemize}

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_abstract_iterator_aa01374b285003faa21b045082063ac12}\label{class_qore_1_1_abstract_iterator_aa01374b285003faa21b045082063ac12}} 
\index{Qore::AbstractIterator@{Qore::AbstractIterator}!getValue@{getValue}}
\index{getValue@{getValue}!Qore::AbstractIterator@{Qore::AbstractIterator}}
\doxysubsubsection{\texorpdfstring{getValue()}{getValue()}}
{\footnotesize\ttfamily abstract auto Qore\+::\+Abstract\+Iterator\+::get\+Value (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



returns the current value 

\begin{DoxyReturn}{Returns}
the current value
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordflow}{while} (i.next()) \{}
\DoxyCodeLine{    printf(\textcolor{stringliteral}{"{}+ \%y\(\backslash\)n"{}}, i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em INVALID-\/\+ITERATOR} & the iterator is not pointing at a valid element\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_qore_1_1_abstract_iterator_aee1def5d872b487b8917a166d9b263e8}{Abstract\+Iterator\+::valid()}} 
\end{DoxySeeAlso}


Implemented in \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_acc1342afce2820c3d1dded7aeb2b8dd8}{Qore\+::\+Abstract\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a97c746cfb641d4e3370c491de36af137}{Qore\+::\+SQL\+::\+Abstract\+SQLStatement}}, \mbox{\hyperlink{class_qore_1_1_data_line_iterator_a0d695de4158d1f10ded8071ae96d3b88}{Qore\+::\+Data\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a83dc18c41ade9e9503d3d21785accbd3}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_iterator_ac476d576e747b685d4284fb02a5cf83e}{Qore\+::\+Hash\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_key_iterator_a749d9db18178ea1f86aa721b3c37a770}{Qore\+::\+Hash\+Key\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_key_reverse_iterator_a2c6cbbc478c54a908faf7766685b4645}{Qore\+::\+Hash\+Key\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a730d7771da0319322b40513e0a23bfbc}{Qore\+::\+Hash\+List\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_pair_iterator_a1b49bc45a3272888838cd4e1fbd0c279}{Qore\+::\+Hash\+Pair\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_pair_reverse_iterator_a151ddbb7fa84b84a0dacac56c758ffb7}{Qore\+::\+Hash\+Pair\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_ac20e677f7b65af6efcad994e8baffcf0}{Qore\+::\+Input\+Stream\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_hash_iterator_a5baf2d3aa4fc660fb47f75ab11cdc130}{Qore\+::\+List\+Hash\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_iterator_a0aa20310feee37f5816721c79fed2b9e}{Qore\+::\+List\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_object_key_iterator_a7b936b687c054fda6f93b76ed04d5292}{Qore\+::\+Object\+Key\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_object_key_reverse_iterator_a3434e0503dad1fd3f569ae330036f573}{Qore\+::\+Object\+Key\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_object_pair_iterator_aefca057a8f1b47d629dcc2e8f8df4d29}{Qore\+::\+Object\+Pair\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_object_pair_reverse_iterator_abf5cc132af0ef0b977396a956bd68084}{Qore\+::\+Object\+Pair\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_range_iterator_a96d2eb508ede8cc4a26141ccf94acecc}{Qore\+::\+Range\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_single_value_iterator_a4f8553281a347e9e10077ab154a1190a}{Qore\+::\+Single\+Value\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a24eba920efaef94c1dd98bf02363f0c9}{Qore\+::\+SQL\+::\+SQLStatement}}.

\mbox{\Hypertarget{class_qore_1_1_abstract_iterator_ab10d5694cc2fcd3b6689ea7494da79de}\label{class_qore_1_1_abstract_iterator_ab10d5694cc2fcd3b6689ea7494da79de}} 
\index{Qore::AbstractIterator@{Qore::AbstractIterator}!next@{next}}
\index{next@{next}!Qore::AbstractIterator@{Qore::AbstractIterator}}
\doxysubsubsection{\texorpdfstring{next()}{next()}}
{\footnotesize\ttfamily abstract bool Qore\+::\+Abstract\+Iterator\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Moves the current position to the next element; returns \mbox{\hyperlink{basic_data_types_False}{False}} if there are no more elements. 

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 object being iterated 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 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{    printf(\textcolor{stringliteral}{"{} + \%y\(\backslash\)n"{}}, i.getValue());}
\DoxyCodeLine{\}}

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_ac5f7742a325b335f3cd2ab0bb5f37272}{Qore\+::\+Abstract\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_a45f7bd62a339149daa3f859012eb626f}{Qore\+::\+SQL\+::\+Abstract\+SQLStatement}}, \mbox{\hyperlink{class_qore_1_1_data_line_iterator_afa97a63c0d6f6ae2410ae3c7ae68696e}{Qore\+::\+Data\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a9e6ad34f365bfeb5e4bcd045daf43921}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_iterator_ae1c8221cd1002edbb93ec41a333900ae}{Qore\+::\+Hash\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a3ceb133242d42f388bdf72ab8f2d5aac}{Qore\+::\+Hash\+List\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_list_reverse_iterator_a40a1167d2e862bf39ef52497387f398d}{Qore\+::\+Hash\+List\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_reverse_iterator_a82746948d972de83d1ef179efc9e9c81}{Qore\+::\+Hash\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_a15869ee0a81ae224334f83f681b6e760}{Qore\+::\+Input\+Stream\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_hash_iterator_a0856d8bc238ce8110e4e9ca14331f295}{Qore\+::\+List\+Hash\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_hash_reverse_iterator_ad5e6281d6b83babe2a1e96b7a801b6e1}{Qore\+::\+List\+Hash\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_iterator_a6ec3a70d479bc98120d5da861a347d16}{Qore\+::\+List\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_reverse_iterator_a49ec4a340d3d713d5865c91d1ead6065}{Qore\+::\+List\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_object_reverse_iterator_a0c9460024246ef2742b9937cb0e3da4d}{Qore\+::\+Object\+Reverse\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_range_iterator_ab2c4071b0c75ac9f721880e483e3e81a}{Qore\+::\+Range\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_single_value_iterator_a2923e45802fc98a2fb9207989710de1d}{Qore\+::\+Single\+Value\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a34dfdc4d3aa9d3c38817931986506fbd}{Qore\+::\+SQL\+::\+SQLStatement}}.

\mbox{\Hypertarget{class_qore_1_1_abstract_iterator_aee1def5d872b487b8917a166d9b263e8}\label{class_qore_1_1_abstract_iterator_aee1def5d872b487b8917a166d9b263e8}} 
\index{Qore::AbstractIterator@{Qore::AbstractIterator}!valid@{valid}}
\index{valid@{valid}!Qore::AbstractIterator@{Qore::AbstractIterator}}
\doxysubsubsection{\texorpdfstring{valid()}{valid()}}
{\footnotesize\ttfamily abstract bool Qore\+::\+Abstract\+Iterator\+::valid (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure 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}{Example\+:}

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

\end{DoxyCode}
 
\end{DoxyParagraph}


Implemented in \mbox{\hyperlink{class_qore_1_1_abstract_line_iterator_a06fc51d01bfae9f17f290ac247ffd3f3}{Qore\+::\+Abstract\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_abstract_s_q_l_statement_ac43800cdf66d8a1e021989194d330306}{Qore\+::\+SQL\+::\+Abstract\+SQLStatement}}, \mbox{\hyperlink{class_qore_1_1_data_line_iterator_af64f428889d1af031d68da288f2f9dbe}{Qore\+::\+Data\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_file_line_iterator_a93c4a650206085736f7bf8efe89ff613}{Qore\+::\+File\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_iterator_a12d469ed0e4ba8b61b8a38fa97332ef1}{Qore\+::\+Hash\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_hash_list_iterator_a9f6eb7c58db7641827e6c9ed12f70b98}{Qore\+::\+Hash\+List\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_input_stream_line_iterator_ad67679ac159cec3362a5faed21f0dcdb}{Qore\+::\+Input\+Stream\+Line\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_hash_iterator_aff5bfd5e591c6306d2deaad6665e0ba8}{Qore\+::\+List\+Hash\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_list_iterator_ad880f2e3e193c708b28d753ae6646bfb}{Qore\+::\+List\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_range_iterator_ad235b23928683ba0929d97f6d6401bb9}{Qore\+::\+Range\+Iterator}}, \mbox{\hyperlink{class_qore_1_1_single_value_iterator_aafb8a835f5535484dc1a1fb97b8a1328}{Qore\+::\+Single\+Value\+Iterator}}, and \mbox{\hyperlink{class_qore_1_1_s_q_l_1_1_s_q_l_statement_a62c5937fb1ce112f54fdfe6f4f49ae24}{Qore\+::\+SQL\+::\+SQLStatement}}.

