\hypertarget{classnntrainer_1_1profile_1_1ProfileListener}{}\doxysection{nntrainer\+::profile\+::Profile\+Listener Class Reference}
\label{classnntrainer_1_1profile_1_1ProfileListener}\index{nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}}


Generic profile listener class to attach to a profiler, this can be inherited to create a custom profile listener.  




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



Inheritance diagram for nntrainer\+::profile\+::Profile\+Listener\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=210pt]{classnntrainer_1_1profile_1_1ProfileListener__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1profile_1_1ProfileListener_a467c193a63947f9626e7c772efc73dab}{Profile\+Listener}} ()=default
\begin{DoxyCompactList}\small\item\em Construct a new Profile Listener object. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{classnntrainer_1_1profile_1_1ProfileListener_a4239c9d489d78512280047ca68ba6e54}{$\sim$\+Profile\+Listener}} () noexcept=default
\begin{DoxyCompactList}\small\item\em Destroy the Base Profile Listener object. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1profile_1_1ProfileListener_a66a4a0fc3ad571d9e22a74b333491d83}{notify}} (P\+R\+O\+F\+I\+L\+E\+\_\+\+E\+V\+E\+NT event, const std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{structnntrainer_1_1profile_1_1ProfileEventData}{Profile\+Event\+Data}} $>$ data)=0
\begin{DoxyCompactList}\small\item\em A callback function to be called from a profiler. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1profile_1_1ProfileListener_a475d380c455d781457eb7e3952c20e20}{reset}} (const int time\+\_\+item, const std\+::string \&str)=0
\begin{DoxyCompactList}\small\item\em resets the listener to the inital state for a particular key \end{DoxyCompactList}\item 
virtual const std\+::chrono\+::microseconds \mbox{\hyperlink{classnntrainer_1_1profile_1_1ProfileListener_a02c29300a7cd5d72ec1d8bda5e1f06a2}{result}} (const int time\+\_\+item)=0
\begin{DoxyCompactList}\small\item\em get the latest result of a event \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1profile_1_1ProfileListener_a67ba452abc15d797679adecce2995e8a}{report}} (std\+::ostream \&out) const =0
\begin{DoxyCompactList}\small\item\em report the result \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Generic profile listener class to attach to a profiler, this can be inherited to create a custom profile listener. 

Definition at line 152 of file profiler.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1profile_1_1ProfileListener_a467c193a63947f9626e7c772efc73dab}\label{classnntrainer_1_1profile_1_1ProfileListener_a467c193a63947f9626e7c772efc73dab}} 
\index{nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}!ProfileListener@{ProfileListener}}
\index{ProfileListener@{ProfileListener}!nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}}
\doxysubsubsection{\texorpdfstring{ProfileListener()}{ProfileListener()}}
{\footnotesize\ttfamily nntrainer\+::profile\+::\+Profile\+Listener\+::\+Profile\+Listener (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}, {\ttfamily [default]}}



Construct a new Profile Listener object. 

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



Destroy the Base Profile Listener object. 



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1profile_1_1ProfileListener_a66a4a0fc3ad571d9e22a74b333491d83}\label{classnntrainer_1_1profile_1_1ProfileListener_a66a4a0fc3ad571d9e22a74b333491d83}} 
\index{nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}!notify@{notify}}
\index{notify@{notify}!nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}}
\doxysubsubsection{\texorpdfstring{notify()}{notify()}}
{\footnotesize\ttfamily virtual void nntrainer\+::profile\+::\+Profile\+Listener\+::notify (\begin{DoxyParamCaption}\item[{P\+R\+O\+F\+I\+L\+E\+\_\+\+E\+V\+E\+NT}]{event,  }\item[{const std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{structnntrainer_1_1profile_1_1ProfileEventData}{Profile\+Event\+Data}} $>$}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



A callback function to be called from a profiler. 


\begin{DoxyParams}{Parameters}
{\em event} & event type \\
\hline
{\em data} & event data \\
\hline
\end{DoxyParams}


Implemented in \mbox{\hyperlink{classnntrainer_1_1profile_1_1GenericProfileListener_a9a40862db6296312535d58b2cc5ba1a8}{nntrainer\+::profile\+::\+Generic\+Profile\+Listener}}.

\mbox{\Hypertarget{classnntrainer_1_1profile_1_1ProfileListener_a67ba452abc15d797679adecce2995e8a}\label{classnntrainer_1_1profile_1_1ProfileListener_a67ba452abc15d797679adecce2995e8a}} 
\index{nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}!report@{report}}
\index{report@{report}!nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}}
\doxysubsubsection{\texorpdfstring{report()}{report()}}
{\footnotesize\ttfamily virtual void nntrainer\+::profile\+::\+Profile\+Listener\+::report (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{out }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}



report the result 


\begin{DoxyParams}{Parameters}
{\em out} & outstream object to make a report \\
\hline
\end{DoxyParams}


Implemented in \mbox{\hyperlink{classnntrainer_1_1profile_1_1GenericProfileListener_a3a4da9abcef9415635310cfce487d5e1}{nntrainer\+::profile\+::\+Generic\+Profile\+Listener}}.

\mbox{\Hypertarget{classnntrainer_1_1profile_1_1ProfileListener_a475d380c455d781457eb7e3952c20e20}\label{classnntrainer_1_1profile_1_1ProfileListener_a475d380c455d781457eb7e3952c20e20}} 
\index{nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}!reset@{reset}}
\index{reset@{reset}!nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}}
\doxysubsubsection{\texorpdfstring{reset()}{reset()}}
{\footnotesize\ttfamily virtual void nntrainer\+::profile\+::\+Profile\+Listener\+::reset (\begin{DoxyParamCaption}\item[{const int}]{time\+\_\+item,  }\item[{const std\+::string \&}]{str }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



resets the listener to the inital state for a particular key 


\begin{DoxyParams}{Parameters}
{\em time\+\_\+item} & time item which will be reset \\
\hline
\end{DoxyParams}


Implemented in \mbox{\hyperlink{classnntrainer_1_1profile_1_1GenericProfileListener_acc6723e5c824045f30e21f3f55ae87df}{nntrainer\+::profile\+::\+Generic\+Profile\+Listener}}.

\mbox{\Hypertarget{classnntrainer_1_1profile_1_1ProfileListener_a02c29300a7cd5d72ec1d8bda5e1f06a2}\label{classnntrainer_1_1profile_1_1ProfileListener_a02c29300a7cd5d72ec1d8bda5e1f06a2}} 
\index{nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}!result@{result}}
\index{result@{result}!nntrainer::profile::ProfileListener@{nntrainer::profile::ProfileListener}}
\doxysubsubsection{\texorpdfstring{result()}{result()}}
{\footnotesize\ttfamily virtual const std\+::chrono\+::microseconds nntrainer\+::profile\+::\+Profile\+Listener\+::result (\begin{DoxyParamCaption}\item[{const int}]{time\+\_\+item }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



get the latest result of a event 


\begin{DoxyParams}{Parameters}
{\em time\+\_\+item} & time item to query the result \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
const std\+::chrono\+::microseconds 
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{classnntrainer_1_1profile_1_1GenericProfileListener_a252b9fd90c69e3ccf3f47f4a3f908cde}{nntrainer\+::profile\+::\+Generic\+Profile\+Listener}}.



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