\hypertarget{classopenutils_1_1_thread}{
\section{openutils::Thread Class Reference}
\label{classopenutils_1_1_thread}\index{openutils::Thread@{openutils::Thread}}
}


{\ttfamily \#include $<$ou\_\-thread.h$>$}

Inheritance diagram for openutils::Thread:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classopenutils_1_1_thread}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classopenutils_1_1_thread_a95c703fb8f2f27cb64f475a8c940864a}{Thread} ()
\item 
\hyperlink{classopenutils_1_1_thread_a25e8ea25dce957746ca1276cf8260799}{Thread} (const char $\ast$nm)
\item 
virtual \hyperlink{classopenutils_1_1_thread_a37d9edd3a1a776cbc27dedff949c9726}{$\sim$Thread} ()
\item 
void \hyperlink{classopenutils_1_1_thread_a99bf834250ab7987b25c4ce8107b67c0}{setName} (const char $\ast$nm)
\item 
std::string \hyperlink{classopenutils_1_1_thread_a5065e76fda2dd1a37c25ea258b3aed59}{getName} () const 
\item 
void \hyperlink{classopenutils_1_1_thread_a1f53ee62bd30a7924186ef26150ce262}{start} ()
\item 
virtual void \hyperlink{classopenutils_1_1_thread_ad9373d8d725c46717dfce3130018fe3a}{run} ()
\item 
void \hyperlink{classopenutils_1_1_thread_ace9338d2dcb1a8914df63467548bc89b}{sleep} (long ms)
\item 
void \hyperlink{classopenutils_1_1_thread_a9eef1ae0ad1749361a607c817eab7787}{suspend} ()
\item 
void \hyperlink{classopenutils_1_1_thread_aa686864d54ff4dd4cadf76297da472f9}{resume} ()
\item 
void \hyperlink{classopenutils_1_1_thread_abd50159ecd409936f454c2321f673616}{stop} ()
\item 
void \hyperlink{classopenutils_1_1_thread_ada8eee7c7e85826a63a049488796302e}{setPriority} (int p)
\item 
bool \hyperlink{classopenutils_1_1_thread_a819a6cac715053481e167d54b6a9f9c0}{wait} (const char $\ast$m, long ms=5000)
\item 
void \hyperlink{classopenutils_1_1_thread_a7b8498d68b928034cf2c959907070e72}{release} (const char $\ast$m)
\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static const int \hyperlink{classopenutils_1_1_thread_aa490c5cc5253d946ad813814d1bea036}{P\_\-ABOVE\_\-NORMAL} = THREAD\_\-PRIORITY\_\-ABOVE\_\-NORMAL
\item 
static const int \hyperlink{classopenutils_1_1_thread_a031a17511a110d69f4b9be484f5ab643}{P\_\-BELOW\_\-NORMAL} = THREAD\_\-PRIORITY\_\-BELOW\_\-NORMAL
\item 
static const int \hyperlink{classopenutils_1_1_thread_a4f5a49b79311921469ea7aea052b3279}{P\_\-HIGHEST} = THREAD\_\-PRIORITY\_\-HIGHEST
\item 
static const int \hyperlink{classopenutils_1_1_thread_a1c70e0c9d94073fac1f726be48052064}{P\_\-IDLE} = THREAD\_\-PRIORITY\_\-IDLE
\item 
static const int \hyperlink{classopenutils_1_1_thread_af81a7846fb2b1a19fcd399db14fc9fdc}{P\_\-LOWEST} = THREAD\_\-PRIORITY\_\-LOWEST
\item 
static const int \hyperlink{classopenutils_1_1_thread_ad26308b90cb3825fcc76d6a34bfe22b9}{P\_\-NORMAL} = THREAD\_\-PRIORITY\_\-NORMAL
\item 
static const int \hyperlink{classopenutils_1_1_thread_a8b39fd5ca0e6db5f3d58c17e201f8b56}{P\_\-CRITICAL} = THREAD\_\-PRIORITY\_\-TIME\_\-CRITICAL
\end{DoxyCompactItemize}


\subsection{Detailed Description}
class \hyperlink{classopenutils_1_1_thread}{Thread} Represents a thread of execution in the process. To create a new \hyperlink{classopenutils_1_1_thread}{Thread} write an inherited class ot \hyperlink{classopenutils_1_1_thread}{Thread} and override the \hyperlink{classopenutils_1_1_thread_ad9373d8d725c46717dfce3130018fe3a}{run()} function 

Definition at line 53 of file ou\_\-thread.h.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{classopenutils_1_1_thread_a95c703fb8f2f27cb64f475a8c940864a}{
\index{openutils::Thread@{openutils::Thread}!Thread@{Thread}}
\index{Thread@{Thread}!openutils::Thread@{openutils::Thread}}
\subsubsection[{Thread}]{\setlength{\rightskip}{0pt plus 5cm}Thread::Thread ()}}
\label{classopenutils_1_1_thread_a95c703fb8f2f27cb64f475a8c940864a}
@ The \hyperlink{classopenutils_1_1_thread}{Thread} class implementation @/

/$\ast$$\ast$ \hyperlink{classopenutils_1_1_thread_a95c703fb8f2f27cb64f475a8c940864a}{Thread()} default constructor 

Definition at line 63 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a25e8ea25dce957746ca1276cf8260799}{
\index{openutils::Thread@{openutils::Thread}!Thread@{Thread}}
\index{Thread@{Thread}!openutils::Thread@{openutils::Thread}}
\subsubsection[{Thread}]{\setlength{\rightskip}{0pt plus 5cm}Thread::Thread (const char $\ast$ {\em nm})}}
\label{classopenutils_1_1_thread_a25e8ea25dce957746ca1276cf8260799}
\hyperlink{classopenutils_1_1_thread_a25e8ea25dce957746ca1276cf8260799}{Thread(const char$\ast$ nm)} overloaded constructor creates a \hyperlink{classopenutils_1_1_thread}{Thread} object identified by \char`\"{}nm\char`\"{} 

Definition at line 72 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a37d9edd3a1a776cbc27dedff949c9726}{
\index{openutils::Thread@{openutils::Thread}!$\sim$Thread@{$\sim$Thread}}
\index{$\sim$Thread@{$\sim$Thread}!openutils::Thread@{openutils::Thread}}
\subsubsection[{$\sim$Thread}]{\setlength{\rightskip}{0pt plus 5cm}Thread::$\sim$Thread ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classopenutils_1_1_thread_a37d9edd3a1a776cbc27dedff949c9726}


Definition at line 77 of file ou\_\-thread.cpp.



\subsection{Member Function Documentation}
\hypertarget{classopenutils_1_1_thread_a5065e76fda2dd1a37c25ea258b3aed59}{
\index{openutils::Thread@{openutils::Thread}!getName@{getName}}
\index{getName@{getName}!openutils::Thread@{openutils::Thread}}
\subsubsection[{getName}]{\setlength{\rightskip}{0pt plus 5cm}string Thread::getName () const}}
\label{classopenutils_1_1_thread_a5065e76fda2dd1a37c25ea258b3aed59}
\hyperlink{classopenutils_1_1_thread_a5065e76fda2dd1a37c25ea258b3aed59}{getName()} return the \hyperlink{classopenutils_1_1_thread}{Thread} object's name as a string 

Definition at line 93 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a7b8498d68b928034cf2c959907070e72}{
\index{openutils::Thread@{openutils::Thread}!release@{release}}
\index{release@{release}!openutils::Thread@{openutils::Thread}}
\subsubsection[{release}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::release (const char $\ast$ {\em m})}}
\label{classopenutils_1_1_thread_a7b8498d68b928034cf2c959907070e72}
\hyperlink{classopenutils_1_1_thread_a7b8498d68b928034cf2c959907070e72}{release(const char$\ast$ m)} releases the mutex \char`\"{}m\char`\"{} and makes it available for other threads 

Definition at line 207 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_aa686864d54ff4dd4cadf76297da472f9}{
\index{openutils::Thread@{openutils::Thread}!resume@{resume}}
\index{resume@{resume}!openutils::Thread@{openutils::Thread}}
\subsubsection[{resume}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::resume ()}}
\label{classopenutils_1_1_thread_aa686864d54ff4dd4cadf76297da472f9}
\hyperlink{classopenutils_1_1_thread_aa686864d54ff4dd4cadf76297da472f9}{resume()} resumes a suspended thread 

Definition at line 168 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_ad9373d8d725c46717dfce3130018fe3a}{
\index{openutils::Thread@{openutils::Thread}!run@{run}}
\index{run@{run}!openutils::Thread@{openutils::Thread}}
\subsubsection[{run}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::run ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classopenutils_1_1_thread_ad9373d8d725c46717dfce3130018fe3a}
\hyperlink{classopenutils_1_1_thread_ad9373d8d725c46717dfce3130018fe3a}{run()} called by the thread callback \hyperlink{ou__thread_8h_ac77d8775b2bbac380745538f7c74f3d4}{\_\-ou\_\-thread\_\-proc()} to be overridden by child classes of \hyperlink{classopenutils_1_1_thread}{Thread} 

Reimplemented in \hyperlink{class_neurosky_a891be27dcb38fb02cd374da8b8bf3fb0}{Neurosky}.



Definition at line 101 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a99bf834250ab7987b25c4ce8107b67c0}{
\index{openutils::Thread@{openutils::Thread}!setName@{setName}}
\index{setName@{setName}!openutils::Thread@{openutils::Thread}}
\subsubsection[{setName}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::setName (const char $\ast$ {\em nm})}}
\label{classopenutils_1_1_thread_a99bf834250ab7987b25c4ce8107b67c0}
\hyperlink{classopenutils_1_1_thread_a99bf834250ab7987b25c4ce8107b67c0}{setName(const char$\ast$ nm)} sets the \hyperlink{classopenutils_1_1_thread}{Thread} object's name to \char`\"{}nm\char`\"{} 

Definition at line 86 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_ada8eee7c7e85826a63a049488796302e}{
\index{openutils::Thread@{openutils::Thread}!setPriority@{setPriority}}
\index{setPriority@{setPriority}!openutils::Thread@{openutils::Thread}}
\subsubsection[{setPriority}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::setPriority (int {\em tp})}}
\label{classopenutils_1_1_thread_ada8eee7c7e85826a63a049488796302e}
\hyperlink{classopenutils_1_1_thread_ada8eee7c7e85826a63a049488796302e}{setPriority(int tp)} sets the priority of the thread to \char`\"{}tp\char`\"{} \char`\"{}tp\char`\"{} must be a valid priority defined in the \hyperlink{classopenutils_1_1_thread}{Thread} class 

Definition at line 142 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_ace9338d2dcb1a8914df63467548bc89b}{
\index{openutils::Thread@{openutils::Thread}!sleep@{sleep}}
\index{sleep@{sleep}!openutils::Thread@{openutils::Thread}}
\subsubsection[{sleep}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::sleep (long {\em ms})}}
\label{classopenutils_1_1_thread_ace9338d2dcb1a8914df63467548bc89b}
\hyperlink{classopenutils_1_1_thread_ace9338d2dcb1a8914df63467548bc89b}{sleep(long ms)} holds back the thread's execution for \char`\"{}ms\char`\"{} milliseconds 

Definition at line 109 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a1f53ee62bd30a7924186ef26150ce262}{
\index{openutils::Thread@{openutils::Thread}!start@{start}}
\index{start@{start}!openutils::Thread@{openutils::Thread}}
\subsubsection[{start}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::start ()}}
\label{classopenutils_1_1_thread_a1f53ee62bd30a7924186ef26150ce262}
\hyperlink{classopenutils_1_1_thread_a1f53ee62bd30a7924186ef26150ce262}{start()} creates a low-\/level thread object and calls the \hyperlink{classopenutils_1_1_thread_ad9373d8d725c46717dfce3130018fe3a}{run()} function 

Definition at line 117 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_abd50159ecd409936f454c2321f673616}{
\index{openutils::Thread@{openutils::Thread}!stop@{stop}}
\index{stop@{stop}!openutils::Thread@{openutils::Thread}}
\subsubsection[{stop}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::stop ()}}
\label{classopenutils_1_1_thread_abd50159ecd409936f454c2321f673616}
\hyperlink{classopenutils_1_1_thread_abd50159ecd409936f454c2321f673616}{stop()} stops the running thread and frees the thread handle 

Definition at line 130 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a9eef1ae0ad1749361a607c817eab7787}{
\index{openutils::Thread@{openutils::Thread}!suspend@{suspend}}
\index{suspend@{suspend}!openutils::Thread@{openutils::Thread}}
\subsubsection[{suspend}]{\setlength{\rightskip}{0pt plus 5cm}void Thread::suspend ()}}
\label{classopenutils_1_1_thread_a9eef1ae0ad1749361a607c817eab7787}
\hyperlink{classopenutils_1_1_thread_a9eef1ae0ad1749361a607c817eab7787}{suspend()} suspends the thread 

Definition at line 155 of file ou\_\-thread.cpp.

\hypertarget{classopenutils_1_1_thread_a819a6cac715053481e167d54b6a9f9c0}{
\index{openutils::Thread@{openutils::Thread}!wait@{wait}}
\index{wait@{wait}!openutils::Thread@{openutils::Thread}}
\subsubsection[{wait}]{\setlength{\rightskip}{0pt plus 5cm}bool Thread::wait (const char $\ast$ {\em m}, \/  long {\em ms} = {\ttfamily 5000})}}
\label{classopenutils_1_1_thread_a819a6cac715053481e167d54b6a9f9c0}
\hyperlink{classopenutils_1_1_thread_a819a6cac715053481e167d54b6a9f9c0}{wait(const char$\ast$ m,long ms)} makes the thread suspend execution until the mutex represented by \char`\"{}m\char`\"{} is released by another thread. \char`\"{}ms\char`\"{} specifies a time-\/out for the wait operation. \char`\"{}ms\char`\"{} defaults to 5000 milli-\/seconds 

Definition at line 184 of file ou\_\-thread.cpp.



\subsection{Member Data Documentation}
\hypertarget{classopenutils_1_1_thread_aa490c5cc5253d946ad813814d1bea036}{
\index{openutils::Thread@{openutils::Thread}!P\_\-ABOVE\_\-NORMAL@{P\_\-ABOVE\_\-NORMAL}}
\index{P\_\-ABOVE\_\-NORMAL@{P\_\-ABOVE\_\-NORMAL}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-ABOVE\_\-NORMAL}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-ABOVE\_\-NORMAL} = THREAD\_\-PRIORITY\_\-ABOVE\_\-NORMAL\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_aa490c5cc5253d946ad813814d1bea036}


Definition at line 81 of file ou\_\-thread.h.

\hypertarget{classopenutils_1_1_thread_a031a17511a110d69f4b9be484f5ab643}{
\index{openutils::Thread@{openutils::Thread}!P\_\-BELOW\_\-NORMAL@{P\_\-BELOW\_\-NORMAL}}
\index{P\_\-BELOW\_\-NORMAL@{P\_\-BELOW\_\-NORMAL}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-BELOW\_\-NORMAL}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-BELOW\_\-NORMAL} = THREAD\_\-PRIORITY\_\-BELOW\_\-NORMAL\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_a031a17511a110d69f4b9be484f5ab643}


Definition at line 82 of file ou\_\-thread.h.

\hypertarget{classopenutils_1_1_thread_a8b39fd5ca0e6db5f3d58c17e201f8b56}{
\index{openutils::Thread@{openutils::Thread}!P\_\-CRITICAL@{P\_\-CRITICAL}}
\index{P\_\-CRITICAL@{P\_\-CRITICAL}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-CRITICAL}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-CRITICAL} = THREAD\_\-PRIORITY\_\-TIME\_\-CRITICAL\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_a8b39fd5ca0e6db5f3d58c17e201f8b56}


Definition at line 87 of file ou\_\-thread.h.

\hypertarget{classopenutils_1_1_thread_a4f5a49b79311921469ea7aea052b3279}{
\index{openutils::Thread@{openutils::Thread}!P\_\-HIGHEST@{P\_\-HIGHEST}}
\index{P\_\-HIGHEST@{P\_\-HIGHEST}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-HIGHEST}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-HIGHEST} = THREAD\_\-PRIORITY\_\-HIGHEST\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_a4f5a49b79311921469ea7aea052b3279}


Definition at line 83 of file ou\_\-thread.h.

\hypertarget{classopenutils_1_1_thread_a1c70e0c9d94073fac1f726be48052064}{
\index{openutils::Thread@{openutils::Thread}!P\_\-IDLE@{P\_\-IDLE}}
\index{P\_\-IDLE@{P\_\-IDLE}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-IDLE}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-IDLE} = THREAD\_\-PRIORITY\_\-IDLE\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_a1c70e0c9d94073fac1f726be48052064}


Definition at line 84 of file ou\_\-thread.h.

\hypertarget{classopenutils_1_1_thread_af81a7846fb2b1a19fcd399db14fc9fdc}{
\index{openutils::Thread@{openutils::Thread}!P\_\-LOWEST@{P\_\-LOWEST}}
\index{P\_\-LOWEST@{P\_\-LOWEST}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-LOWEST}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-LOWEST} = THREAD\_\-PRIORITY\_\-LOWEST\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_af81a7846fb2b1a19fcd399db14fc9fdc}


Definition at line 85 of file ou\_\-thread.h.

\hypertarget{classopenutils_1_1_thread_ad26308b90cb3825fcc76d6a34bfe22b9}{
\index{openutils::Thread@{openutils::Thread}!P\_\-NORMAL@{P\_\-NORMAL}}
\index{P\_\-NORMAL@{P\_\-NORMAL}!openutils::Thread@{openutils::Thread}}
\subsubsection[{P\_\-NORMAL}]{\setlength{\rightskip}{0pt plus 5cm}const int {\bf Thread::P\_\-NORMAL} = THREAD\_\-PRIORITY\_\-NORMAL\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classopenutils_1_1_thread_ad26308b90cb3825fcc76d6a34bfe22b9}


Definition at line 86 of file ou\_\-thread.h.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
neurosky/header/\hyperlink{ou__thread_8h}{ou\_\-thread.h}\item 
neurosky/src/\hyperlink{ou__thread_8cpp}{ou\_\-thread.cpp}\end{DoxyCompactItemize}
