\hypertarget{classnntrainer_1_1Task}{}\doxysection{nntrainer\+::Task Class Reference}
\label{classnntrainer_1_1Task}\index{nntrainer::Task@{nntrainer::Task}}


task class  




{\ttfamily \#include $<$task.\+h$>$}



Inheritance diagram for nntrainer\+::Task\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=226pt]{classnntrainer_1_1Task__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classnntrainer_1_1Task_a9389d115a1f7c46520b7dd1de3060862}\label{classnntrainer_1_1Task_a9389d115a1f7c46520b7dd1de3060862}} 
enum \mbox{\hyperlink{classnntrainer_1_1Task_a9389d115a1f7c46520b7dd1de3060862}{Type}} \{ {\bfseries S\+Y\+NC}, 
{\bfseries A\+S\+Y\+NC}
 \}
\begin{DoxyCompactList}\small\item\em task type \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1Task_a3fc37cab5329e425fbc0a1df317b06f3}\label{classnntrainer_1_1Task_a3fc37cab5329e425fbc0a1df317b06f3}} 
enum \mbox{\hyperlink{classnntrainer_1_1Task_a3fc37cab5329e425fbc0a1df317b06f3}{State}} \{ {\bfseries C\+R\+E\+A\+T\+ED}, 
{\bfseries S\+T\+A\+R\+T\+ED}, 
{\bfseries P\+R\+O\+C\+E\+S\+S\+I\+NG}, 
{\bfseries D\+O\+NE}
 \}
\begin{DoxyCompactList}\small\item\em task state \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}\label{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}} 
using \mbox{\hyperlink{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}{Work}} = std\+::function$<$ int(std\+::atomic\+\_\+bool \&running, void $\ast$data)$>$
\begin{DoxyCompactList}\small\item\em work function \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1Task_a1fd49ab46d359d086f1f693ac8e01b77}{Task}} (\mbox{\hyperlink{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}{Work}} w, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1Task}{Task}} constructor. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{classnntrainer_1_1Task_ad50b5fb15416f71d634adb145f547b45}{$\sim$\+Task}} ()=default
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. \end{DoxyCompactList}\item 
virtual const \mbox{\hyperlink{classnntrainer_1_1Task_a9389d115a1f7c46520b7dd1de3060862}{Task\+::\+Type}} \mbox{\hyperlink{classnntrainer_1_1Task_a0a5d6b0abff12bc09a1c6b30ac7e9dff}{get\+Type}} (void)
\begin{DoxyCompactList}\small\item\em Get type of task. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1Task_a19da0ea0bffa49290622113a9c49af17}{started}} (void)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1Task_afeb246179534059f6b7ca37d4c9b3447}{done}} (void)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. \end{DoxyCompactList}\item 
const \mbox{\hyperlink{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}{Work}} \mbox{\hyperlink{classnntrainer_1_1Task_a4a75e0658802d9ebe629efd0ffe4f026}{get\+Work}} (void)
\begin{DoxyCompactList}\small\item\em Get work of task. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{classnntrainer_1_1Task_a980a68e41afec37b271dcc59b93c1009}{get\+Data}} (void)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1Task_a7a1f902c6b7f0422a2d2635486b3e7a5}{set\+State}} (\mbox{\hyperlink{classnntrainer_1_1Task_a3fc37cab5329e425fbc0a1df317b06f3}{State}} s)
\begin{DoxyCompactList}\small\item\em Set task state. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
task class 

Definition at line 27 of file task.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1Task_a1fd49ab46d359d086f1f693ac8e01b77}\label{classnntrainer_1_1Task_a1fd49ab46d359d086f1f693ac8e01b77}} 
\index{nntrainer::Task@{nntrainer::Task}!Task@{Task}}
\index{Task@{Task}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{Task()}{Task()}}
{\footnotesize\ttfamily nntrainer\+::\+Task\+::\+Task (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}{Work}}}]{w,  }\item[{void $\ast$}]{user\+\_\+data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}}



\mbox{\hyperlink{classnntrainer_1_1Task}{Task}} constructor. 



Definition at line 56 of file task.\+h.

\mbox{\Hypertarget{classnntrainer_1_1Task_ad50b5fb15416f71d634adb145f547b45}\label{classnntrainer_1_1Task_ad50b5fb15416f71d634adb145f547b45}} 
\index{nntrainer::Task@{nntrainer::Task}!````~Task@{$\sim$Task}}
\index{````~Task@{$\sim$Task}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{$\sim$Task()}{~Task()}}
{\footnotesize\ttfamily virtual nntrainer\+::\+Task\+::$\sim$\+Task (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}, {\ttfamily [default]}}



\mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. 



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1Task_afeb246179534059f6b7ca37d4c9b3447}\label{classnntrainer_1_1Task_afeb246179534059f6b7ca37d4c9b3447}} 
\index{nntrainer::Task@{nntrainer::Task}!done@{done}}
\index{done@{done}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{done()}{done()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Task\+::done (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



\mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. 

\begin{DoxyReturn}{Returns}
true if state is after done, else false 
\end{DoxyReturn}


Definition at line 86 of file task.\+h.

\mbox{\Hypertarget{classnntrainer_1_1Task_a980a68e41afec37b271dcc59b93c1009}\label{classnntrainer_1_1Task_a980a68e41afec37b271dcc59b93c1009}} 
\index{nntrainer::Task@{nntrainer::Task}!getData@{getData}}
\index{getData@{getData}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{getData()}{getData()}}
{\footnotesize\ttfamily void$\ast$ nntrainer\+::\+Task\+::get\+Data (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



\mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. 

\begin{DoxyReturn}{Returns}
user data 
\end{DoxyReturn}


Definition at line 100 of file task.\+h.

\mbox{\Hypertarget{classnntrainer_1_1Task_a0a5d6b0abff12bc09a1c6b30ac7e9dff}\label{classnntrainer_1_1Task_a0a5d6b0abff12bc09a1c6b30ac7e9dff}} 
\index{nntrainer::Task@{nntrainer::Task}!getType@{getType}}
\index{getType@{getType}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{getType()}{getType()}}
{\footnotesize\ttfamily virtual const \mbox{\hyperlink{classnntrainer_1_1Task_a9389d115a1f7c46520b7dd1de3060862}{Task\+::\+Type}} nntrainer\+::\+Task\+::get\+Type (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Get type of task. 

\begin{DoxyReturn}{Returns}
type of task \mbox{\hyperlink{classnntrainer_1_1Task_a9389d115a1f7c46520b7dd1de3060862}{Task\+::\+Type}} 
\end{DoxyReturn}


Reimplemented in \mbox{\hyperlink{classnntrainer_1_1TaskAsync_a0b59a1e1fb217951712742e6f0cb661c}{nntrainer\+::\+Task\+Async$<$ T $>$}}.



Definition at line 72 of file task.\+h.

\mbox{\Hypertarget{classnntrainer_1_1Task_a4a75e0658802d9ebe629efd0ffe4f026}\label{classnntrainer_1_1Task_a4a75e0658802d9ebe629efd0ffe4f026}} 
\index{nntrainer::Task@{nntrainer::Task}!getWork@{getWork}}
\index{getWork@{getWork}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{getWork()}{getWork()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}{Work}} nntrainer\+::\+Task\+::get\+Work (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Get work of task. 

\begin{DoxyReturn}{Returns}
work function \mbox{\hyperlink{classnntrainer_1_1Task_a7c5e468f05bb723a3b8c6316053ce624}{Task\+::\+Work}} 
\end{DoxyReturn}


Definition at line 93 of file task.\+h.

\mbox{\Hypertarget{classnntrainer_1_1Task_a7a1f902c6b7f0422a2d2635486b3e7a5}\label{classnntrainer_1_1Task_a7a1f902c6b7f0422a2d2635486b3e7a5}} 
\index{nntrainer::Task@{nntrainer::Task}!setState@{setState}}
\index{setState@{setState}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{setState()}{setState()}}
{\footnotesize\ttfamily void nntrainer\+::\+Task\+::set\+State (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classnntrainer_1_1Task_a3fc37cab5329e425fbc0a1df317b06f3}{State}}}]{s }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set task state. 


\begin{DoxyParams}{Parameters}
{\em s} & state to be set \\
\hline
\end{DoxyParams}


Definition at line 107 of file task.\+h.

\mbox{\Hypertarget{classnntrainer_1_1Task_a19da0ea0bffa49290622113a9c49af17}\label{classnntrainer_1_1Task_a19da0ea0bffa49290622113a9c49af17}} 
\index{nntrainer::Task@{nntrainer::Task}!started@{started}}
\index{started@{started}!nntrainer::Task@{nntrainer::Task}}
\doxysubsubsection{\texorpdfstring{started()}{started()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Task\+::started (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



\mbox{\hyperlink{classnntrainer_1_1Task}{Task}} destructor. 

\begin{DoxyReturn}{Returns}
true if state is after started, else false 
\end{DoxyReturn}


Definition at line 79 of file task.\+h.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
tensor/\mbox{\hyperlink{task_8h}{task.\+h}}\end{DoxyCompactItemize}
