\hypertarget{classnntrainer_1_1ScopedView}{}\doxysection{nntrainer\+::Scoped\+View$<$ T $>$ Class Template Reference}
\label{classnntrainer_1_1ScopedView}\index{nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}}


A view container that calls a callback on destruct.  




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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1ScopedView_a58c0c4a8f7e6c6050aa9c474e958047b}{Scoped\+View}} (T $\ast$data\+\_\+, std\+::function$<$ void(void)$>$ \&\&on\+\_\+notify\+\_\+=nullptr, std\+::function$<$ void(void)$>$ \&\&on\+\_\+error\+\_\+=nullptr)
\begin{DoxyCompactList}\small\item\em Construct a new Scoped View object. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1ScopedView_a98e2b26ec9ba87a6b362ce4551d630ac}\label{classnntrainer_1_1ScopedView_a98e2b26ec9ba87a6b362ce4551d630ac}} 
{\bfseries Scoped\+View} (const \mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} \&rhs)=delete
\item 
\mbox{\Hypertarget{classnntrainer_1_1ScopedView_aa08a2b2c2941fc64a327d7d4c9a36930}\label{classnntrainer_1_1ScopedView_aa08a2b2c2941fc64a327d7d4c9a36930}} 
\mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} \& {\bfseries operator=} (const \mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} \&rhs)=delete
\item 
\mbox{\Hypertarget{classnntrainer_1_1ScopedView_a6b5c77a093ea4446ac141168e50fd0a7}\label{classnntrainer_1_1ScopedView_a6b5c77a093ea4446ac141168e50fd0a7}} 
{\bfseries Scoped\+View} (\mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} \&\&rhs)=default
\item 
\mbox{\Hypertarget{classnntrainer_1_1ScopedView_a9e31e70d56dde5c86373906cc60fb9d1}\label{classnntrainer_1_1ScopedView_a9e31e70d56dde5c86373906cc60fb9d1}} 
\mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} \& {\bfseries operator=} (\mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} \&\&rhs)=default
\item 
bool \mbox{\hyperlink{classnntrainer_1_1ScopedView_a5711bee3adb59e4a6c2360dcfa23996f}{is\+Empty}} ()
\begin{DoxyCompactList}\small\item\em check if scoped view contains any underlying data \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1ScopedView_aeae54efaeb73d938ed5ccd4435b5cc85}{$\sim$\+Scoped\+View}} ()
\begin{DoxyCompactList}\small\item\em Destroy the Scoped View object, callback is called at this time. \end{DoxyCompactList}\item 
T \& \mbox{\hyperlink{classnntrainer_1_1ScopedView_ab8619ec7f73379d6ae5be7aabfdd8e1c}{get}} ()
\begin{DoxyCompactList}\small\item\em get the underlying data \end{DoxyCompactList}\item 
const T \& \mbox{\hyperlink{classnntrainer_1_1ScopedView_aba66103de438003bc8756caaf2938b9b}{get}} () const
\begin{DoxyCompactList}\small\item\em get the underlying data \end{DoxyCompactList}\end{DoxyCompactItemize}


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

A view container that calls a callback on destruct. 

\begin{DoxyNote}{Note}
the callback must be noexcept, and the given underlying data must outlive the lifetime of this class
\end{DoxyNote}

\begin{DoxyTemplParams}{Template Parameters}
{\em T} & underlying type \\
\hline
\end{DoxyTemplParams}


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



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1ScopedView_a58c0c4a8f7e6c6050aa9c474e958047b}\label{classnntrainer_1_1ScopedView_a58c0c4a8f7e6c6050aa9c474e958047b}} 
\index{nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}!ScopedView@{ScopedView}}
\index{ScopedView@{ScopedView}!nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{ScopedView()}{ScopedView()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
\mbox{\hyperlink{classnntrainer_1_1ScopedView}{nntrainer\+::\+Scoped\+View}}$<$ T $>$\+::\mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} (\begin{DoxyParamCaption}\item[{T $\ast$}]{data\+\_\+,  }\item[{std\+::function$<$ void(void)$>$ \&\&}]{on\+\_\+notify\+\_\+ = {\ttfamily nullptr},  }\item[{std\+::function$<$ void(void)$>$ \&\&}]{on\+\_\+error\+\_\+ = {\ttfamily nullptr} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Construct a new Scoped View object. 


\begin{DoxyParams}{Parameters}
{\em data\+\_\+} & reference of the underlying data \\
\hline
{\em on\+\_\+notify\+\_\+} & callback to be called on exit \\
\hline
{\em on\+\_\+error\+\_\+} & callback to be called on error \\
\hline
\end{DoxyParams}


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

\mbox{\Hypertarget{classnntrainer_1_1ScopedView_aeae54efaeb73d938ed5ccd4435b5cc85}\label{classnntrainer_1_1ScopedView_aeae54efaeb73d938ed5ccd4435b5cc85}} 
\index{nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}!````~ScopedView@{$\sim$ScopedView}}
\index{````~ScopedView@{$\sim$ScopedView}!nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{$\sim$ScopedView()}{~ScopedView()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
\mbox{\hyperlink{classnntrainer_1_1ScopedView}{nntrainer\+::\+Scoped\+View}}$<$ T $>$\+::$\sim$\mbox{\hyperlink{classnntrainer_1_1ScopedView}{Scoped\+View}} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Destroy the Scoped View object, callback is called at this time. 



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



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1ScopedView_ab8619ec7f73379d6ae5be7aabfdd8e1c}\label{classnntrainer_1_1ScopedView_ab8619ec7f73379d6ae5be7aabfdd8e1c}} 
\index{nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}!get@{get}}
\index{get@{get}!nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get()}{get()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
T\& \mbox{\hyperlink{classnntrainer_1_1ScopedView}{nntrainer\+::\+Scoped\+View}}$<$ T $>$\+::get (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



get the underlying data 

\begin{DoxyReturn}{Returns}
T \& reference to the underlying data 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1ScopedView_aba66103de438003bc8756caaf2938b9b}\label{classnntrainer_1_1ScopedView_aba66103de438003bc8756caaf2938b9b}} 
\index{nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}!get@{get}}
\index{get@{get}!nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get()}{get()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
const T\& \mbox{\hyperlink{classnntrainer_1_1ScopedView}{nntrainer\+::\+Scoped\+View}}$<$ T $>$\+::get (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



get the underlying data 

\begin{DoxyReturn}{Returns}
T \& reference to the underlying data 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1ScopedView_a5711bee3adb59e4a6c2360dcfa23996f}\label{classnntrainer_1_1ScopedView_a5711bee3adb59e4a6c2360dcfa23996f}} 
\index{nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}!isEmpty@{isEmpty}}
\index{isEmpty@{isEmpty}!nntrainer::ScopedView$<$ T $>$@{nntrainer::ScopedView$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{isEmpty()}{isEmpty()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
bool \mbox{\hyperlink{classnntrainer_1_1ScopedView}{nntrainer\+::\+Scoped\+View}}$<$ T $>$\+::is\+Empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



check if scoped view contains any underlying data 

\begin{DoxyReturn}{Returns}
bool if data is empty 
\end{DoxyReturn}


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



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}
