\hypertarget{class_s_c_i_run_1_1_atomic_counter}{\section{Atomic\-Counter Class Reference}
\label{class_s_c_i_run_1_1_atomic_counter}\index{Atomic\-Counter@{Atomic\-Counter}}
}


{\ttfamily \#include $<$Atomic\-Counter.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_s_c_i_run_1_1_atomic_counter_a3e7aec686fe041660675505bd55c572e}{Atomic\-Counter} (const char $\ast$\hyperlink{_boost_graph_example_tests_8cc_a8ad72759d07f18eaf8f6690e5dfb747c}{name})
\item 
\hyperlink{class_s_c_i_run_1_1_atomic_counter_a2aac8dbbadc6f70b82eb7f790226a58b}{Atomic\-Counter} (const char $\ast$\hyperlink{_boost_graph_example_tests_8cc_a8ad72759d07f18eaf8f6690e5dfb747c}{name}, int value)
\item 
\hyperlink{class_s_c_i_run_1_1_atomic_counter_a29b70a0004fc9bff0cd08466262e9a2c}{$\sim$\-Atomic\-Counter} ()
\begin{DoxyCompactList}\small\item\em Destroy the atomic counter. \end{DoxyCompactList}\item 
\hyperlink{class_s_c_i_run_1_1_atomic_counter_a6a6c0aaee2d785b48a1e57710ceb586b}{operator int} () const 
\item 
int \hyperlink{class_s_c_i_run_1_1_atomic_counter_aac042557bdb79bddb22a4411f123a533}{operator++} ()
\item 
int \hyperlink{class_s_c_i_run_1_1_atomic_counter_a5526c2c4b0fa541a50ffcaaf25e149a6}{operator++} (int)
\begin{DoxyCompactList}\small\item\em Increment the counter and return the old value. \end{DoxyCompactList}\item 
int \hyperlink{class_s_c_i_run_1_1_atomic_counter_a223991a75e50cde290582136ef563dc0}{operator-\/-\/} ()
\item 
int \hyperlink{class_s_c_i_run_1_1_atomic_counter_a5496187b3dcf6064c5c0b158ab6b7264}{operator-\/-\/} (int)
\begin{DoxyCompactList}\small\item\em Decrement the counter and return the old value. \end{DoxyCompactList}\item 
void \hyperlink{class_s_c_i_run_1_1_atomic_counter_a1ae529ea110ef11d678029f21a840375}{set} (int)
\begin{DoxyCompactList}\small\item\em Set the counter to a new value. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_s_c_i_run_1_1_atomic_counter_a3e7aec686fe041660675505bd55c572e}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!Atomic\-Counter@{Atomic\-Counter}}
\index{Atomic\-Counter@{Atomic\-Counter}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{Atomic\-Counter}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Atomic\-Counter} (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a3e7aec686fe041660675505bd55c572e}
Create an atomic counter with an unspecified initial value. {\ttfamily name} should be a static string which describes the primitive for debugging purposes. \hypertarget{class_s_c_i_run_1_1_atomic_counter_a2aac8dbbadc6f70b82eb7f790226a58b}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!Atomic\-Counter@{Atomic\-Counter}}
\index{Atomic\-Counter@{Atomic\-Counter}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{Atomic\-Counter}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Atomic\-Counter} (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{int}]{value}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a2aac8dbbadc6f70b82eb7f790226a58b}
Create an atomic counter with an initial value. name should be a static string which describes the primitive for debugging purposes. \hypertarget{class_s_c_i_run_1_1_atomic_counter_a29b70a0004fc9bff0cd08466262e9a2c}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!$\sim$\-Atomic\-Counter@{$\sim$\-Atomic\-Counter}}
\index{$\sim$\-Atomic\-Counter@{$\sim$\-Atomic\-Counter}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{$\sim$\-Atomic\-Counter}]{\setlength{\rightskip}{0pt plus 5cm}$\sim${\bf Atomic\-Counter} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a29b70a0004fc9bff0cd08466262e9a2c}


Destroy the atomic counter. 



\subsection{Member Function Documentation}
\hypertarget{class_s_c_i_run_1_1_atomic_counter_a6a6c0aaee2d785b48a1e57710ceb586b}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!operator int@{operator int}}
\index{operator int@{operator int}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{operator int}]{\setlength{\rightskip}{0pt plus 5cm}operator int (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{class_s_c_i_run_1_1_atomic_counter_a6a6c0aaee2d785b48a1e57710ceb586b}
Allows the atomic counter to be used in expressions like a normal integer. Note that multiple calls to this function may return different values if other threads are manipulating the counter. \hypertarget{class_s_c_i_run_1_1_atomic_counter_aac042557bdb79bddb22a4411f123a533}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!operator++@{operator++}}
\index{operator++@{operator++}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{operator++}]{\setlength{\rightskip}{0pt plus 5cm}int operator++ (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_aac042557bdb79bddb22a4411f123a533}
Increment the counter and return the new value. This does not return \hyperlink{class_s_c_i_run_1_1_atomic_counter}{Atomic\-Counter}\& like a normal ++ operator would, because it would destroy atomicity \hypertarget{class_s_c_i_run_1_1_atomic_counter_a5526c2c4b0fa541a50ffcaaf25e149a6}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!operator++@{operator++}}
\index{operator++@{operator++}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{operator++}]{\setlength{\rightskip}{0pt plus 5cm}int operator++ (
\begin{DoxyParamCaption}
\item[{int}]{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a5526c2c4b0fa541a50ffcaaf25e149a6}


Increment the counter and return the old value. 

\hypertarget{class_s_c_i_run_1_1_atomic_counter_a223991a75e50cde290582136ef563dc0}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!operator-\/-\/@{operator-\/-\/}}
\index{operator-\/-\/@{operator-\/-\/}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{operator-\/-\/}]{\setlength{\rightskip}{0pt plus 5cm}int operator-\/-\/ (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a223991a75e50cde290582136ef563dc0}
Decrement the counter and return the new value This does not return \hyperlink{class_s_c_i_run_1_1_atomic_counter}{Atomic\-Counter}\& like a normal -- operator would, because it would destroy atomicity \hypertarget{class_s_c_i_run_1_1_atomic_counter_a5496187b3dcf6064c5c0b158ab6b7264}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!operator-\/-\/@{operator-\/-\/}}
\index{operator-\/-\/@{operator-\/-\/}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{operator-\/-\/}]{\setlength{\rightskip}{0pt plus 5cm}int operator-\/-\/ (
\begin{DoxyParamCaption}
\item[{int}]{}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a5496187b3dcf6064c5c0b158ab6b7264}


Decrement the counter and return the old value. 

\hypertarget{class_s_c_i_run_1_1_atomic_counter_a1ae529ea110ef11d678029f21a840375}{\index{S\-C\-I\-Run\-::\-Atomic\-Counter@{S\-C\-I\-Run\-::\-Atomic\-Counter}!set@{set}}
\index{set@{set}!SCIRun::AtomicCounter@{S\-C\-I\-Run\-::\-Atomic\-Counter}}
\subsubsection[{set}]{\setlength{\rightskip}{0pt plus 5cm}void set (
\begin{DoxyParamCaption}
\item[{int}]{v}
\end{DoxyParamCaption}
)}}\label{class_s_c_i_run_1_1_atomic_counter_a1ae529ea110ef11d678029f21a840375}


Set the counter to a new value. 



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
Core/\-Thread/\-Legacy/\hyperlink{_atomic_counter_8h}{Atomic\-Counter.\-h}\item 
Core/\-Thread/\-Legacy/\hyperlink{_thread__none_8cc}{Thread\-\_\-none.\-cc}\end{DoxyCompactItemize}
