Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 618

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::Atomic\-Counter Class Reference}
\label{classost_1_1_atomic_counter}\index{ost::AtomicCounter@{ost::AtomicCounter}}
The {\bf Atomic\-Counter}{\rm (p.\,\pageref{classost_1_1_atomic_counter})} class offers thread-safe manipulation of an integer counter.atomic counter operation.  


{\tt \#include $<$thread.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Atomic\-Counter} ()
\begin{CompactList}\small\item\em Initialize an atomic counter to 0. \item\end{CompactList}\item 
{\bf Atomic\-Counter} (int value)
\begin{CompactList}\small\item\em Initialize an atomic counter to a known value. \item\end{CompactList}\item 
{\bf $\sim$Atomic\-Counter} ()
\item 
int {\bf operator++} (void)
\item 
int {\bf operator--} (void)
\item 
int {\bf operator+=} (int change)
\item 
int {\bf operator-=} (int change)
\item 
int {\bf operator+} (int change)
\item 
int {\bf operator-} (int change)
\item 
int {\bf operator=} (int value)
\item 
bool {\bf operator!} (void)
\item 
{\bf operator int} ()
\end{CompactItemize}


\subsection{Detailed Description}
The {\bf Atomic\-Counter}{\rm (p.\,\pageref{classost_1_1_atomic_counter})} class offers thread-safe manipulation of an integer counter.atomic counter operation. 

These are commonly used for building thread-safe \char`\"{}reference\char`\"{} counters for C++ classes. The {\bf Atomic\-Counter}{\rm (p.\,\pageref{classost_1_1_atomic_counter})} depends on the platforms support for \char`\"{}atomic\char`\"{} integer operations, and can alternately substitute a \char`\"{}mutex\char`\"{} if no atomic support exists.

\begin{Desc}
\item[Author:]Sean Cavanaugh $<${\tt sean@dimensionalrift.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::AtomicCounter@{ost::Atomic\-Counter}!AtomicCounter@{AtomicCounter}}
\index{AtomicCounter@{AtomicCounter}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Atomic\-Counter::Atomic\-Counter ()}\label{classost_1_1_atomic_counter_e44557ac95d1e1526ad02dcf7c81dc36}


Initialize an atomic counter to 0. 

\index{ost::AtomicCounter@{ost::Atomic\-Counter}!AtomicCounter@{AtomicCounter}}
\index{AtomicCounter@{AtomicCounter}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Atomic\-Counter::Atomic\-Counter (int {\em value})}\label{classost_1_1_atomic_counter_004464040b9f78cb18ebf6467212b3c9}


Initialize an atomic counter to a known value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em value}]initial value. \end{description}
\end{Desc}
\index{ost::AtomicCounter@{ost::Atomic\-Counter}!~AtomicCounter@{$\sim$AtomicCounter}}
\index{~AtomicCounter@{$\sim$AtomicCounter}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Atomic\-Counter::$\sim$Atomic\-Counter ()}\label{classost_1_1_atomic_counter_7b9046be70726e7eb240f4efe0e011b7}




\subsection{Member Function Documentation}
\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator int@{operator int}}
\index{operator int@{operator int}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::Atomic\-Counter::operator int ()}\label{classost_1_1_atomic_counter_8ee3bcf3d61dfdaa0f7fac8469bbb1b5}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator"!@{operator"!}}
\index{operator"!@{operator"!}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool ost::Atomic\-Counter::operator! (void)}\label{classost_1_1_atomic_counter_3e8b4023edf8a1bc8c54eb4b23dda5f9}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator+@{operator+}}
\index{operator+@{operator+}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator+ (int {\em change})}\label{classost_1_1_atomic_counter_7f7cba5fbc973f7e1bf3f9edf6930144}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator++@{operator++}}
\index{operator++@{operator++}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator++ (void)}\label{classost_1_1_atomic_counter_349673acccaf8bec1e3a1ef75a09f3ad}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator+=@{operator+=}}
\index{operator+=@{operator+=}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator+= (int {\em change})}\label{classost_1_1_atomic_counter_d001e499d8c5396b168fe73d8ac2d414}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator-@{operator-}}
\index{operator-@{operator-}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator- (int {\em change})}\label{classost_1_1_atomic_counter_3b4f8261461cff8bfa43df8a8f6141b5}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator--@{operator--}}
\index{operator--@{operator--}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator-- (void)}\label{classost_1_1_atomic_counter_9188ebc2b9c15b85a672d55090c98988}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator-=@{operator-=}}
\index{operator-=@{operator-=}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator-= (int {\em change})}\label{classost_1_1_atomic_counter_4b2ee002defdb42a8c65930de8317328}


\index{ost::AtomicCounter@{ost::Atomic\-Counter}!operator=@{operator=}}
\index{operator=@{operator=}!ost::AtomicCounter@{ost::Atomic\-Counter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int ost::Atomic\-Counter::operator= (int {\em value})}\label{classost_1_1_atomic_counter_0b9546c50c3c34c9188a5c31fdf8d5dd}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf thread.h}\end{CompactItemize}