\hypertarget{class_qore_1_1_list_reverse_iterator}{}\section{Qore\+:\+:List\+Reverse\+Iterator Class Reference}
\label{class_qore_1_1_list_reverse_iterator}\index{Qore\+::\+List\+Reverse\+Iterator@{Qore\+::\+List\+Reverse\+Iterator}}


This class an iterator class for lists.  




Inheritance diagram for Qore\+:\+:List\+Reverse\+Iterator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_qore_1_1_list_reverse_iterator__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_qore_1_1_list_reverse_iterator_a4bffb0e810009ca7e1a9f4ffde3c2321}{constructor} (softlist$<$ auto $>$ l)
\begin{DoxyCompactList}\small\item\em Creates the list iterator object. \end{DoxyCompactList}\item 
\hyperlink{class_qore_1_1_list_reverse_iterator_a138c1cb74e5366d16c4124d126f9dcbd}{copy} ()
\begin{DoxyCompactList}\small\item\em Creates a copy of the \hyperlink{class_qore_1_1_list_reverse_iterator}{List\+Reverse\+Iterator} object, iterating the same object as the original and in the same position. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_list_reverse_iterator_a2e8154d62fdeb3d8f08b3b26c048f24b}{first} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if on the first element iterated with this iterator (ie the last element in the list) \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_list_reverse_iterator_a33bf7f6114d76f5c1b8c80a5d7dc6fac}{last} ()
\begin{DoxyCompactList}\small\item\em returns \hyperlink{basic_data_types_True}{True} if on the last element iterated with this iterator (ie the first element in the list) \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_list_reverse_iterator_a49ec4a340d3d713d5865c91d1ead6065}{next} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the previous element in the list; 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 list if the list is not empty. \end{DoxyCompactList}\item 
bool \hyperlink{class_qore_1_1_list_reverse_iterator_aae132f219a250cedb11bcf67995422dc}{prev} ()
\begin{DoxyCompactList}\small\item\em Moves the current position to the next element in the list; 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 list if the list is not empty. \end{DoxyCompactList}\end{DoxyCompactItemize}


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

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

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

\begin{DoxyCode}
list data = (1, \textcolor{stringliteral}{"foo"}, 2);
ListReverseIterator it(data);
\textcolor{keywordflow}{while} (it.next()) \{
    \hyperlink{group__string__functions_ga32070517a9f8a70a32ef48f83a6f128e}{printf}(\textcolor{stringliteral}{"iter: %n\(\backslash\)n"}, it.getValue());
\}

iter: 2
iter: \textcolor{stringliteral}{"foo"}
iter: 1
\end{DoxyCode}

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

\begin{DoxyItemize}
\item In general, the \hyperlink{class_qore_1_1_list_reverse_iterator}{List\+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_list_reverse_iterator}{List\+Reverse\+Iterator} is functionally equivalent to \hyperlink{class_qore_1_1_list_iterator}{List\+Iterator}, but the effect of \hyperlink{class_qore_1_1_list_reverse_iterator_a49ec4a340d3d713d5865c91d1ead6065}{List\+Reverse\+Iterator\+::next()} and \hyperlink{class_qore_1_1_list_reverse_iterator_aae132f219a250cedb11bcf67995422dc}{List\+Reverse\+Iterator\+::prev()} are the opposite of \hyperlink{class_qore_1_1_list_iterator_a6ec3a70d479bc98120d5da861a347d16}{List\+Iterator\+::next()} and \hyperlink{class_qore_1_1_list_iterator_a32ad9cb8256759fdf8ac4dd3af183222}{List\+Iterator\+::prev()}; that is \hyperlink{class_qore_1_1_list_reverse_iterator_a49ec4a340d3d713d5865c91d1ead6065}{List\+Reverse\+Iterator\+::next()} will iterate through the list in reverse order, while \hyperlink{class_qore_1_1_list_reverse_iterator_aae132f219a250cedb11bcf67995422dc}{List\+Reverse\+Iterator\+::prev()} iterates in forward order. Additionally the meanings of the return values for \hyperlink{class_qore_1_1_list_reverse_iterator_a2e8154d62fdeb3d8f08b3b26c048f24b}{List\+Reverse\+Iterator\+::first()} and \hyperlink{class_qore_1_1_list_reverse_iterator_a33bf7f6114d76f5c1b8c80a5d7dc6fac}{List\+Reverse\+Iterator\+::last()} are swapped in respect to \hyperlink{class_qore_1_1_list_iterator_a93b82a5f331015eacbc41114005af1c0}{List\+Iterator\+::first()} and \hyperlink{class_qore_1_1_list_iterator_ab42d03f4202ae21cbf50732c93a206c2}{List\+Iterator\+::last()}.
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\hyperlink{class_qore_1_1_list_iterator}{List\+Iterator} 
\end{DoxySeeAlso}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_list_reverse_iterator_a4bffb0e810009ca7e1a9f4ffde3c2321}\label{class_qore_1_1_list_reverse_iterator_a4bffb0e810009ca7e1a9f4ffde3c2321}} 
\index{Qore\+::\+List\+Reverse\+Iterator@{Qore\+::\+List\+Reverse\+Iterator}!constructor@{constructor}}
\index{constructor@{constructor}!Qore\+::\+List\+Reverse\+Iterator@{Qore\+::\+List\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{constructor()}{constructor()}}
{\footnotesize\ttfamily Qore\+::\+List\+Reverse\+Iterator\+::constructor (\begin{DoxyParamCaption}\item[{softlist$<$ auto $>$}]{l }\end{DoxyParamCaption})}



Creates the list iterator object. 


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

\begin{DoxyCode}
ListReverseIterator li(l);
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
the constructor\textquotesingle{}s argument is \hyperlink{data_type_declarations_softlist_type}{softlist} so that it can also accept \hyperlink{basic_data_types_nothing}{N\+O\+T\+H\+I\+NG} 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_list_reverse_iterator_a138c1cb74e5366d16c4124d126f9dcbd}\label{class_qore_1_1_list_reverse_iterator_a138c1cb74e5366d16c4124d126f9dcbd}} 
\index{Qore\+::\+List\+Reverse\+Iterator@{Qore\+::\+List\+Reverse\+Iterator}!copy@{copy}}
\index{copy@{copy}!Qore\+::\+List\+Reverse\+Iterator@{Qore\+::\+List\+Reverse\+Iterator}}
\subsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+List\+Reverse\+Iterator\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



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

\begin{DoxyParagraph}{Example\+:}

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



returns \hyperlink{basic_data_types_True}{True} if on the first element iterated with this iterator (ie the last element in the list) 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if on the first element iterated with this iterator (ie the last element in the list)
\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}


Reimplemented from \hyperlink{class_qore_1_1_list_iterator_a93b82a5f331015eacbc41114005af1c0}{Qore\+::\+List\+Iterator}.

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



returns \hyperlink{basic_data_types_True}{True} if on the last element iterated with this iterator (ie the first element in the list) 

\begin{DoxyReturn}{Returns}
\hyperlink{basic_data_types_True}{True} if on the last element iterated with this iterator (ie the first element in the list)
\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}


Reimplemented from \hyperlink{class_qore_1_1_list_iterator_ab42d03f4202ae21cbf50732c93a206c2}{Qore\+::\+List\+Iterator}.

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



Moves the current position to the previous element in the list; 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 list if the list 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 list 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 list (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\(\backslash\)n"}, i.getValue());
\}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
\hyperlink{class_qore_1_1_list_reverse_iterator_a49ec4a340d3d713d5865c91d1ead6065}{List\+Reverse\+Iterator\+::next()} is the opposite of \hyperlink{class_qore_1_1_list_iterator_a6ec3a70d479bc98120d5da861a347d16}{List\+Iterator\+::next()}; it is functionally equivalent to \hyperlink{class_qore_1_1_list_iterator_a32ad9cb8256759fdf8ac4dd3af183222}{List\+Iterator\+::prev()}; \hyperlink{class_qore_1_1_list_reverse_iterator_a49ec4a340d3d713d5865c91d1ead6065}{List\+Reverse\+Iterator\+::next()} iterates through the list in reverse order
\end{DoxyNote}

\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}


Reimplemented from \hyperlink{class_qore_1_1_list_iterator_a6ec3a70d479bc98120d5da861a347d16}{Qore\+::\+List\+Iterator}.

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



Moves the current position to the next element in the list; 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 list if the list 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 list 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 list (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\(\backslash\)n"}, i.getValue());
\}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
\hyperlink{class_qore_1_1_list_reverse_iterator_aae132f219a250cedb11bcf67995422dc}{List\+Reverse\+Iterator\+::prev()} is the opposite of \hyperlink{class_qore_1_1_list_iterator_a32ad9cb8256759fdf8ac4dd3af183222}{List\+Iterator\+::prev()}; it is functionally equivalent to \hyperlink{class_qore_1_1_list_iterator_a6ec3a70d479bc98120d5da861a347d16}{List\+Iterator\+::next()}; \hyperlink{class_qore_1_1_list_reverse_iterator_aae132f219a250cedb11bcf67995422dc}{List\+Reverse\+Iterator\+::prev()} iterates through the list in forward order
\end{DoxyNote}

\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}


Reimplemented from \hyperlink{class_qore_1_1_list_iterator_a32ad9cb8256759fdf8ac4dd3af183222}{Qore\+::\+List\+Iterator}.

