\hypertarget{class_qore_1_1_thread_1_1_sequence}{}\doxysection{Qore\+::Thread\+::Sequence Class Reference}
\label{class_qore_1_1_thread_1_1_sequence}\index{Qore::Thread::Sequence@{Qore::Thread::Sequence}}


The \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} class implements a thread-\/safe increment-\/only object.  


\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence_a020b3a0402c75abea84bdc04aec4c4b7}{constructor}} ()
\begin{DoxyCompactList}\small\item\em Creates a new \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence_a08ec436eeb5ac7a6c83163fb75c08f0c}{constructor}} (softint start)
\begin{DoxyCompactList}\small\item\em Creates a new \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} object with a starting value. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence_a91e6bdc3c82dc98c819e9baa24255675}{copy}} ()
\begin{DoxyCompactList}\small\item\em Creates a new \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} object, not based on the original. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence_a8cfb34ab095d34f19eba6c801c409a05}{get\+Current}} ()
\begin{DoxyCompactList}\small\item\em Returns the current value of the sequence. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence_a329ae94ca0aa803c2d259d62e591f4bd}{next}} ()
\begin{DoxyCompactList}\small\item\em Atomically increments the sequence value and returns the last value. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} class implements a thread-\/safe increment-\/only object. 

This class does not block therefore is not tagged with \mbox{\hyperlink{group__parse__options_gade963e1fbbd1f5b2c777df7221512a1b}{Qore\+::\+PO\+\_\+\+NO\+\_\+\+THREAD\+\_\+\+CLASSES}} 

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



Creates a new \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} object. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Sequence seq();}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_thread_1_1_sequence_a08ec436eeb5ac7a6c83163fb75c08f0c}\label{class_qore_1_1_thread_1_1_sequence_a08ec436eeb5ac7a6c83163fb75c08f0c}} 
\index{Qore::Thread::Sequence@{Qore::Thread::Sequence}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::Thread::Sequence@{Qore::Thread::Sequence}}
\doxysubsubsection{\texorpdfstring{constructor()}{constructor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Qore\+::\+Thread\+::\+Sequence\+::constructor (\begin{DoxyParamCaption}\item[{softint}]{start }\end{DoxyParamCaption})}



Creates a new \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} object with a starting value. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Sequence seq(20);}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_thread_1_1_sequence_a91e6bdc3c82dc98c819e9baa24255675}\label{class_qore_1_1_thread_1_1_sequence_a91e6bdc3c82dc98c819e9baa24255675}} 
\index{Qore::Thread::Sequence@{Qore::Thread::Sequence}!copy@{copy}}
\index{copy@{copy}!Qore::Thread::Sequence@{Qore::Thread::Sequence}}
\doxysubsubsection{\texorpdfstring{copy()}{copy()}}
{\footnotesize\ttfamily Qore\+::\+Thread\+::\+Sequence\+::copy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Creates a new \mbox{\hyperlink{class_qore_1_1_thread_1_1_sequence}{Sequence}} object, not based on the original. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{Sequence s2 = seq.copy();}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_thread_1_1_sequence_a8cfb34ab095d34f19eba6c801c409a05}\label{class_qore_1_1_thread_1_1_sequence_a8cfb34ab095d34f19eba6c801c409a05}} 
\index{Qore::Thread::Sequence@{Qore::Thread::Sequence}!getCurrent@{getCurrent}}
\index{getCurrent@{getCurrent}!Qore::Thread::Sequence@{Qore::Thread::Sequence}}
\doxysubsubsection{\texorpdfstring{getCurrent()}{getCurrent()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Thread\+::\+Sequence\+::get\+Current (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the current value of the sequence. 

\begin{DoxyReturn}{Returns}
current value of the sequence
\end{DoxyReturn}
\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int v = seq.getCurrent();}

\end{DoxyCode}
 
\end{DoxyParagraph}
\mbox{\Hypertarget{class_qore_1_1_thread_1_1_sequence_a329ae94ca0aa803c2d259d62e591f4bd}\label{class_qore_1_1_thread_1_1_sequence_a329ae94ca0aa803c2d259d62e591f4bd}} 
\index{Qore::Thread::Sequence@{Qore::Thread::Sequence}!next@{next}}
\index{next@{next}!Qore::Thread::Sequence@{Qore::Thread::Sequence}}
\doxysubsubsection{\texorpdfstring{next()}{next()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Thread\+::\+Sequence\+::next (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Atomically increments the sequence value and returns the last value. 

\begin{DoxyReturn}{Returns}
the last value of the sequence 
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int next = seq.next();}

\end{DoxyCode}
 
\end{DoxyParagraph}
