\hypertarget{structefl_1_1eina_1_1thread}{}\section{efl\+:\+:eina\+:\+:thread Struct Reference}
\label{structefl_1_1eina_1_1thread}\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}}


Provides an O\+OP interface to the {\ttfamily Eina\+\_\+\+Thread} and automatic resource allocation and deallocation using the R\+A\+II programming idiom.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef \hyperlink{structefl_1_1eina_1_1thread__id}{thread\+\_\+id} \hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{id}
\begin{DoxyCompactList}\small\item\em Type for the thread identifier. \end{DoxyCompactList}\item 
typedef \hyperlink{group__Eina__Thread__Group_ga1e85dc4b7b825ef36a5ae9d8b710523a}{Eina\+\_\+\+Thread} \hyperlink{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{native\+\_\+handle\+\_\+type}
\begin{DoxyCompactList}\small\item\em Type for the native Eina\+\_\+\+Thread handle. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_ac48f4f7fce325046ccd1e2fe4330dd5e}\label{structefl_1_1eina_1_1thread_ac48f4f7fce325046ccd1e2fe4330dd5e}} 
\hyperlink{structefl_1_1eina_1_1thread_ac48f4f7fce325046ccd1e2fe4330dd5e}{thread} () noexcept
\begin{DoxyCompactList}\small\item\em Creates a thread object that does not represent any thread of execution. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename F , class ... Args$>$ }\\\hyperlink{structefl_1_1eina_1_1thread_ad9b8ad36124422460bb985813257b7c8}{thread} (F \&\&f, Args \&\&... args)
\begin{DoxyCompactList}\small\item\em Creates a thread of execution. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread_a2f654639d29ba0dc8c48530ce65e00ff}{thread} (\hyperlink{structefl_1_1eina_1_1thread}{thread} \&\&other)
\begin{DoxyCompactList}\small\item\em Move constructor. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread}{thread} \& \hyperlink{structefl_1_1eina_1_1thread_affee79f1f4ec8f41c98acc6de0664f36}{operator=} (\hyperlink{structefl_1_1eina_1_1thread}{thread} \&\&other)
\begin{DoxyCompactList}\small\item\em Transfer the thread of execution. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_ae920394ce60aeef2934ec397158674d0}\label{structefl_1_1eina_1_1thread_ae920394ce60aeef2934ec397158674d0}} 
\hyperlink{structefl_1_1eina_1_1thread_ae920394ce60aeef2934ec397158674d0}{$\sim$thread} ()
\begin{DoxyCompactList}\small\item\em Destroys the thread object. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1thread_a76baa9217273ac58ff03bc46379de1cb}{swap} (\hyperlink{structefl_1_1eina_1_1thread}{thread} \&other) noexcept
\begin{DoxyCompactList}\small\item\em Exchanges the underlying handles of two thread objects. \end{DoxyCompactList}\item 
bool \hyperlink{structefl_1_1eina_1_1thread_a45210ada18c73bbc2f1da6dd850ddeca}{joinable} () const noexcept
\begin{DoxyCompactList}\small\item\em Check if the thread object identifies an active thread of execution. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1thread_a0e1729a168d44421cf4fcdb67636fb4a}{join} ()
\begin{DoxyCompactList}\small\item\em Wait for the thread to finish its execution. \end{DoxyCompactList}\item 
void \hyperlink{structefl_1_1eina_1_1thread_a8e086bb24eeb164a248bf577f2817370}{detach} ()
\begin{DoxyCompactList}\small\item\em Detaches the thread from its handle, making it runs independently. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{id} \hyperlink{structefl_1_1eina_1_1thread_a459d0e90b6233a1a009bf897cd7067cf}{get\+\_\+id} () const noexcept
\begin{DoxyCompactList}\small\item\em Returns the identifier of the thread associated with this thread object. \end{DoxyCompactList}\item 
\hyperlink{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{native\+\_\+handle\+\_\+type} \hyperlink{structefl_1_1eina_1_1thread_a34f2407adbfd89a82742ce158e76b920}{native\+\_\+handle} () const
\begin{DoxyCompactList}\small\item\em Get a handle for the wrapped {\ttfamily Eina\+\_\+\+Thread}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static unsigned \hyperlink{structefl_1_1eina_1_1thread_abb9255a7ffe7433e6b0d9b8304229a26}{hardware\+\_\+concurrency} () noexcept
\begin{DoxyCompactList}\small\item\em Get the number of hardware concurrent threads. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Provides an O\+OP interface to the {\ttfamily Eina\+\_\+\+Thread} and automatic resource allocation and deallocation using the R\+A\+II programming idiom. 

This class implements threads in a way that strongly resembles the S\+TL {\ttfamily std\+::thread}. 

\subsection{Member Typedef Documentation}
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}\label{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!id@{id}}
\index{id@{id}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{id}{id}}
{\footnotesize\ttfamily typedef \hyperlink{structefl_1_1eina_1_1thread__id}{thread\+\_\+id} \hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{efl\+::eina\+::thread\+::id}}



Type for the thread identifier. 

\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}\label{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!native\+\_\+handle\+\_\+type@{native\+\_\+handle\+\_\+type}}
\index{native\+\_\+handle\+\_\+type@{native\+\_\+handle\+\_\+type}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{native\+\_\+handle\+\_\+type}{native\_handle\_type}}
{\footnotesize\ttfamily typedef \hyperlink{group__Eina__Thread__Group_ga1e85dc4b7b825ef36a5ae9d8b710523a}{Eina\+\_\+\+Thread} \hyperlink{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{efl\+::eina\+::thread\+::native\+\_\+handle\+\_\+type}}



Type for the native Eina\+\_\+\+Thread handle. 



\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_ad9b8ad36124422460bb985813257b7c8}\label{structefl_1_1eina_1_1thread_ad9b8ad36124422460bb985813257b7c8}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!thread@{thread}}
\index{thread@{thread}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{thread()}{thread()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename F , class ... Args$>$ \\
efl\+::eina\+::thread\+::thread (\begin{DoxyParamCaption}\item[{F \&\&}]{f,  }\item[{Args \&\&...}]{args }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}}



Creates a thread of execution. 


\begin{DoxyParams}{Parameters}
{\em f} & Pointer to function or callable object to execute in the new thread. The return value (if any) is ignored. \\
\hline
{\em args} & Arguments to pass to the {\ttfamily f}.\\
\hline
\end{DoxyParams}
This constructor creates a thread object that represents a thread of execution. The new thread of execution calls {\ttfamily f} passing {\ttfamily args} as arguments (all arguments are copied/moved to thread-\/accessible storage).

Any exceptions thrown during evaluation and copying/moving of the arguments are thrown in the current thread, not the new thread. 

References eina\+\_\+condition\+\_\+new(), eina\+\_\+lock\+\_\+new(), eina\+\_\+thread\+\_\+create(), and efl\+::eina\+::get\+\_\+error\+\_\+code().

\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a2f654639d29ba0dc8c48530ce65e00ff}\label{structefl_1_1eina_1_1thread_a2f654639d29ba0dc8c48530ce65e00ff}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!thread@{thread}}
\index{thread@{thread}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{thread()}{thread()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily efl\+::eina\+::thread\+::thread (\begin{DoxyParamCaption}\item[{\hyperlink{structefl_1_1eina_1_1thread}{thread} \&\&}]{other }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Move constructor. 

Transfer the thread of execution to the new object. 
\begin{DoxyParams}{Parameters}
{\em other} & Another thread object to construct this thread object with.\\
\hline
\end{DoxyParams}
This constructor creates a thread object that acquires the thread of execution represented by {\ttfamily other}. This operation does not affect the execution of the moved thread, it simply transfers its handler.

\begin{DoxyNote}{Note}
After this call {\ttfamily other} no longer represents a thread of execution. 
\end{DoxyNote}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_affee79f1f4ec8f41c98acc6de0664f36}\label{structefl_1_1eina_1_1thread_affee79f1f4ec8f41c98acc6de0664f36}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!operator=@{operator=}}
\index{operator=@{operator=}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{operator=()}{operator=()}}
{\footnotesize\ttfamily \hyperlink{structefl_1_1eina_1_1thread}{thread}\& efl\+::eina\+::thread\+::operator= (\begin{DoxyParamCaption}\item[{\hyperlink{structefl_1_1eina_1_1thread}{thread} \&\&}]{other }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Transfer the thread of execution. 


\begin{DoxyParams}{Parameters}
{\em other} & Another thread object to assign to this thread object. \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
After this call {\ttfamily other} no longer represents a thread of execution. 
\end{DoxyNote}
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a76baa9217273ac58ff03bc46379de1cb}\label{structefl_1_1eina_1_1thread_a76baa9217273ac58ff03bc46379de1cb}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!swap@{swap}}
\index{swap@{swap}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{swap()}{swap()}}
{\footnotesize\ttfamily void efl\+::eina\+::thread\+::swap (\begin{DoxyParamCaption}\item[{\hyperlink{structefl_1_1eina_1_1thread}{thread} \&}]{other }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Exchanges the underlying handles of two thread objects. 


\begin{DoxyParams}{Parameters}
{\em other} & Another thread object. \\
\hline
\end{DoxyParams}


References efl\+::eina\+::swap().



Referenced by efl\+::eina\+::swap().

\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a45210ada18c73bbc2f1da6dd850ddeca}\label{structefl_1_1eina_1_1thread_a45210ada18c73bbc2f1da6dd850ddeca}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!joinable@{joinable}}
\index{joinable@{joinable}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{joinable()}{joinable()}}
{\footnotesize\ttfamily bool efl\+::eina\+::thread\+::joinable (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Check if the thread object identifies an active thread of execution. 

\begin{DoxyReturn}{Returns}
{\ttfamily true} if the thread object identifies an active thread of execution, {\ttfamily false} otherwise.
\end{DoxyReturn}
This member function checks if the thread object identifies an active thread of execution. A default constructed thread is not joinable, as well as a thread that its members join or detach has been called.

A thread that has finished executing code, but has not yet been joined is still considered an active thread of execution and is therefore joinable. \mbox{\Hypertarget{structefl_1_1eina_1_1thread_a0e1729a168d44421cf4fcdb67636fb4a}\label{structefl_1_1eina_1_1thread_a0e1729a168d44421cf4fcdb67636fb4a}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!join@{join}}
\index{join@{join}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{join()}{join()}}
{\footnotesize\ttfamily void efl\+::eina\+::thread\+::join (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Wait for the thread to finish its execution. 

This member function blocks the calling thread until the thread identified by this object finishes its execution.

\begin{DoxyNote}{Note}
A joinable thread becomes not joinable after a call to this function. 
\end{DoxyNote}


References eina\+\_\+thread\+\_\+join().

\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a8e086bb24eeb164a248bf577f2817370}\label{structefl_1_1eina_1_1thread_a8e086bb24eeb164a248bf577f2817370}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!detach@{detach}}
\index{detach@{detach}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{detach()}{detach()}}
{\footnotesize\ttfamily void efl\+::eina\+::thread\+::detach (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Detaches the thread from its handle, making it runs independently. 

This member function separates the thread of execution from the thread object, allowing execution to continue independently.

\begin{DoxyNote}{Note}
After a call to this function, the thread object becomes non-\/joinable. 
\end{DoxyNote}
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a459d0e90b6233a1a009bf897cd7067cf}\label{structefl_1_1eina_1_1thread_a459d0e90b6233a1a009bf897cd7067cf}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!get\+\_\+id@{get\+\_\+id}}
\index{get\+\_\+id@{get\+\_\+id}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{get\+\_\+id()}{get\_id()}}
{\footnotesize\ttfamily \hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{id} efl\+::eina\+::thread\+::get\+\_\+id (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}



Returns the identifier of the thread associated with this thread object. 

\begin{DoxyReturn}{Returns}
{\ttfamily \hyperlink{structefl_1_1eina_1_1thread_ac6a467d6f099d5c27148650f37f3ae16}{thread\+::id}} identifying the thread associated with this thread object. 
\end{DoxyReturn}
\mbox{\Hypertarget{structefl_1_1eina_1_1thread_a34f2407adbfd89a82742ce158e76b920}\label{structefl_1_1eina_1_1thread_a34f2407adbfd89a82742ce158e76b920}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!native\+\_\+handle@{native\+\_\+handle}}
\index{native\+\_\+handle@{native\+\_\+handle}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{native\+\_\+handle()}{native\_handle()}}
{\footnotesize\ttfamily \hyperlink{structefl_1_1eina_1_1thread_a12cc900f3388fb5cbaa87cbea0a40fa1}{native\+\_\+handle\+\_\+type} efl\+::eina\+::thread\+::native\+\_\+handle (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get a handle for the wrapped {\ttfamily Eina\+\_\+\+Thread}. 

\begin{DoxyReturn}{Returns}
Handle for the native {\ttfamily Eina\+\_\+\+Thread}.
\end{DoxyReturn}
This member function returns the native {\ttfamily Eina\+\_\+\+Thread} handle that is wrapped inside this object. \mbox{\Hypertarget{structefl_1_1eina_1_1thread_abb9255a7ffe7433e6b0d9b8304229a26}\label{structefl_1_1eina_1_1thread_abb9255a7ffe7433e6b0d9b8304229a26}} 
\index{efl\+::eina\+::thread@{efl\+::eina\+::thread}!hardware\+\_\+concurrency@{hardware\+\_\+concurrency}}
\index{hardware\+\_\+concurrency@{hardware\+\_\+concurrency}!efl\+::eina\+::thread@{efl\+::eina\+::thread}}
\subsubsection{\texorpdfstring{hardware\+\_\+concurrency()}{hardware\_concurrency()}}
{\footnotesize\ttfamily static unsigned efl\+::eina\+::thread\+::hardware\+\_\+concurrency (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}, {\ttfamily [noexcept]}}



Get the number of hardware concurrent threads. 

\begin{DoxyReturn}{Returns}
A hint on the number of hardware concurrent threads, or {\ttfamily 0} if the value is not well defined or not computable.
\end{DoxyReturn}
This static member function returns the number of hardware concurrent threads.

\begin{DoxyNote}{Note}
The interpretation of this value is implementation-\/specific, and may be just an approximation. 
\end{DoxyNote}


References eina\+\_\+cpu\+\_\+count().

