\hypertarget{classnntrainer_1_1ViewQueue}{}\doxysection{nntrainer\+::View\+Queue$<$ T $>$ Class Template Reference}
\label{classnntrainer_1_1ViewQueue}\index{nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}}


Thread Safe Queue implementation dedicated for the non-\/owing pointer.  




{\ttfamily \#include $<$iteration\+\_\+queue.\+h$>$}

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classnntrainer_1_1ViewQueue_af01c12385673b53682e7191c7b7f04d2}\label{classnntrainer_1_1ViewQueue_af01c12385673b53682e7191c7b7f04d2}} 
\mbox{\hyperlink{classnntrainer_1_1ViewQueue_af01c12385673b53682e7191c7b7f04d2}{View\+Queue}} ()
\begin{DoxyCompactList}\small\item\em Construct a new queue. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1ViewQueue_ab91ea4543d66e1303e3e2bc83cd651d3}{push}} (T $\ast$data)
\begin{DoxyCompactList}\small\item\em push data to queue \end{DoxyCompactList}\item 
T $\ast$ \mbox{\hyperlink{classnntrainer_1_1ViewQueue_a58544d7c28ce47003b46d904e969880e}{wait\+And\+Pop}} ()
\begin{DoxyCompactList}\small\item\em pop data from the queue, wait if empty \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1ViewQueue_a01d0415c22a8b7d1edc5dd68b35a4378}{is\+Empty}} () const
\begin{DoxyCompactList}\small\item\em check if current queue is empty \end{DoxyCompactList}\item 
std\+::queue$<$ T $\ast$ $>$\+::size\+\_\+type \mbox{\hyperlink{classnntrainer_1_1ViewQueue_ad9f0cb2f159bc9d61d41b421c23d173a}{size}} () const
\begin{DoxyCompactList}\small\item\em check if current queue is empty \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename T$>$\newline
class nntrainer\+::\+View\+Queue$<$ T $>$}

Thread Safe Queue implementation dedicated for the non-\/owing pointer. 


\begin{DoxyTemplParams}{Template Parameters}
{\em original} & type of the view (T $\ast$ will be pushed and pop) \\
\hline
\end{DoxyTemplParams}


Definition at line 38 of file iteration\+\_\+queue.\+h.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1ViewQueue_a01d0415c22a8b7d1edc5dd68b35a4378}\label{classnntrainer_1_1ViewQueue_a01d0415c22a8b7d1edc5dd68b35a4378}} 
\index{nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{isEmpty()}{isEmpty()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
bool \mbox{\hyperlink{classnntrainer_1_1ViewQueue}{nntrainer\+::\+View\+Queue}}$<$ T $>$\+::is\+Empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



check if current queue is empty 

\begin{DoxyReturn}{Returns}
bool true if empty 
\end{DoxyReturn}


Definition at line 79 of file iteration\+\_\+queue.\+h.

\mbox{\Hypertarget{classnntrainer_1_1ViewQueue_ab91ea4543d66e1303e3e2bc83cd651d3}\label{classnntrainer_1_1ViewQueue_ab91ea4543d66e1303e3e2bc83cd651d3}} 
\index{nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}!push@{push}}
\index{push@{push}!nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{push()}{push()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
void \mbox{\hyperlink{classnntrainer_1_1ViewQueue}{nntrainer\+::\+View\+Queue}}$<$ T $>$\+::push (\begin{DoxyParamCaption}\item[{T $\ast$}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



push data to queue 


\begin{DoxyParams}{Parameters}
{\em data} & data to put \\
\hline
\end{DoxyParams}


Definition at line 50 of file iteration\+\_\+queue.\+h.

\mbox{\Hypertarget{classnntrainer_1_1ViewQueue_ad9f0cb2f159bc9d61d41b421c23d173a}\label{classnntrainer_1_1ViewQueue_ad9f0cb2f159bc9d61d41b421c23d173a}} 
\index{nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}!size@{size}}
\index{size@{size}!nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{size()}{size()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
std\+::queue$<$T $\ast$$>$\+::size\+\_\+type \mbox{\hyperlink{classnntrainer_1_1ViewQueue}{nntrainer\+::\+View\+Queue}}$<$ T $>$\+::size (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



check if current queue is empty 

\begin{DoxyReturn}{Returns}
bool true if empty 
\end{DoxyReturn}


Definition at line 89 of file iteration\+\_\+queue.\+h.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1ViewQueue_ad9f0cb2f159bc9d61d41b421c23d173a_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1ViewQueue_a58544d7c28ce47003b46d904e969880e}\label{classnntrainer_1_1ViewQueue_a58544d7c28ce47003b46d904e969880e}} 
\index{nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}!waitAndPop@{waitAndPop}}
\index{waitAndPop@{waitAndPop}!nntrainer::ViewQueue$<$ T $>$@{nntrainer::ViewQueue$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{waitAndPop()}{waitAndPop()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
T$\ast$ \mbox{\hyperlink{classnntrainer_1_1ViewQueue}{nntrainer\+::\+View\+Queue}}$<$ T $>$\+::wait\+And\+Pop (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



pop data from the queue, wait if empty 

\begin{DoxyNote}{Note}
when fail to get, this will return nullptr (eg) when interrupt happens) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
T$\ast$ view of the data 
\end{DoxyReturn}


Definition at line 65 of file iteration\+\_\+queue.\+h.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1ViewQueue_a58544d7c28ce47003b46d904e969880e_icgraph}
\end{center}
\end{figure}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
dataset/\mbox{\hyperlink{iteration__queue_8h}{iteration\+\_\+queue.\+h}}\end{DoxyCompactItemize}
