\hypertarget{a00060}{
\section{mln::accu::count\_\-value$<$ V $>$ Struct Template Reference}
\label{d9/d73/a00060}\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}}
}


Define an accumulator that counts the occurrence of a given value.  




{\ttfamily \#include $<$count\_\-value.hh$>$}



Inherits base$<$ unsigned, count\_\-value$<$ V $>$ $>$.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{a00060_a393a52cee601dd9856813d3bf3d2aaad}{is\_\-valid} () const 
\begin{DoxyCompactList}\small\item\em Check whether this accu is able to return a result. \item\end{DoxyCompactList}\item 
void \hyperlink{a00026_a745794a4ef16926d3c09ebbaa8b6b557}{take\_\-as\_\-init} (const T \&t)
\begin{DoxyCompactList}\small\item\em Take as initialization the value {\ttfamily t}. \item\end{DoxyCompactList}\item 
void \hyperlink{a00026_a138e094daa1a85f345bbdfd852c9fc67}{take\_\-n\_\-times} (unsigned n, const T \&t)
\begin{DoxyCompactList}\small\item\em Take {\ttfamily n} times the value {\ttfamily t}. \item\end{DoxyCompactList}\item 
unsigned \hyperlink{a00060_a9b7b534e586da6c070058cd813002399}{to\_\-result} () const 
\begin{DoxyCompactList}\small\item\em Get the value of the accumulator. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}{\bf }\par
{\em \label{_amgrpd41d8cd98f00b204e9800998ecf8427e}
 }\begin{DoxyCompactItemize}
\item 
void \hyperlink{a00060_a768d624637837482d050313961f376de}{init} ()
\begin{DoxyCompactList}\small\item\em Manipulators. \item\end{DoxyCompactList}\item 
void \hyperlink{a00060_a5b5d176f7bb92376cb204d92b49569a5}{set\_\-value} (unsigned c)
\begin{DoxyCompactList}\small\item\em Force the value of the counter to {\itshape c\/}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}


\subsection{Detailed Description}
\subsubsection*{template$<$typename V$>$ struct mln::accu::count\_\-value$<$ V $>$}

Define an accumulator that counts the occurrence of a given value. 

Definition at line 72 of file count\_\-value.hh.



\subsection{Member Function Documentation}
\hypertarget{a00060_a768d624637837482d050313961f376de}{
\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}!init@{init}}
\index{init@{init}!mln::accu::count_value@{mln::accu::count\_\-value}}
\subsubsection[{init}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename V $>$ void {\bf mln::accu::count\_\-value}$<$ V $>$::init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d73/a00060_a768d624637837482d050313961f376de}


Manipulators. 



Definition at line 153 of file count\_\-value.hh.

\hypertarget{a00060_a393a52cee601dd9856813d3bf3d2aaad}{
\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}!is\_\-valid@{is\_\-valid}}
\index{is\_\-valid@{is\_\-valid}!mln::accu::count_value@{mln::accu::count\_\-value}}
\subsubsection[{is\_\-valid}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename V $>$ bool {\bf mln::accu::count\_\-value}$<$ V $>$::is\_\-valid (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d73/a00060_a393a52cee601dd9856813d3bf3d2aaad}


Check whether this accu is able to return a result. 

Always true here. 

Definition at line 216 of file count\_\-value.hh.

\hypertarget{a00060_a5b5d176f7bb92376cb204d92b49569a5}{
\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}!set\_\-value@{set\_\-value}}
\index{set\_\-value@{set\_\-value}!mln::accu::count_value@{mln::accu::count\_\-value}}
\subsubsection[{set\_\-value}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename V $>$ void {\bf mln::accu::count\_\-value}$<$ V $>$::set\_\-value (
\begin{DoxyParamCaption}
\item[{unsigned}]{ c}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d73/a00060_a5b5d176f7bb92376cb204d92b49569a5}


Force the value of the counter to {\itshape c\/}. 



Definition at line 208 of file count\_\-value.hh.

\hypertarget{a00026_a745794a4ef16926d3c09ebbaa8b6b557}{
\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}!take\_\-as\_\-init@{take\_\-as\_\-init}}
\index{take\_\-as\_\-init@{take\_\-as\_\-init}!mln::accu::count_value@{mln::accu::count\_\-value}}
\subsubsection[{take\_\-as\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf count\_\-value}$<$ V $>$  $>$::take\_\-as\_\-init (
\begin{DoxyParamCaption}
\item[{const T \&}]{ t}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inherited\mbox{]}}}}
\label{d6/d5b/a00026_a745794a4ef16926d3c09ebbaa8b6b557}


Take as initialization the value {\ttfamily t}. 

Dev note: this is a final method; override if needed by take\_\-as\_\-init\_\- (ending with '\_\-'). \hypertarget{a00026_a138e094daa1a85f345bbdfd852c9fc67}{
\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}!take\_\-n\_\-times@{take\_\-n\_\-times}}
\index{take\_\-n\_\-times@{take\_\-n\_\-times}!mln::accu::count_value@{mln::accu::count\_\-value}}
\subsubsection[{take\_\-n\_\-times}]{\setlength{\rightskip}{0pt plus 5cm}void {\bf mln::Accumulator}$<$ {\bf count\_\-value}$<$ V $>$  $>$::take\_\-n\_\-times (
\begin{DoxyParamCaption}
\item[{unsigned}]{ n, }
\item[{const T \&}]{ t}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inherited\mbox{]}}}}
\label{d6/d5b/a00026_a138e094daa1a85f345bbdfd852c9fc67}


Take {\ttfamily n} times the value {\ttfamily t}. 

Dev note: this is a final method; override if needed by take\_\-as\_\-init\_\- (ending with '\_\-'). \hypertarget{a00060_a9b7b534e586da6c070058cd813002399}{
\index{mln::accu::count\_\-value@{mln::accu::count\_\-value}!to\_\-result@{to\_\-result}}
\index{to\_\-result@{to\_\-result}!mln::accu::count_value@{mln::accu::count\_\-value}}
\subsubsection[{to\_\-result}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename V $>$ unsigned {\bf mln::accu::count\_\-value}$<$ V $>$::to\_\-result (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{d9/d73/a00060_a9b7b534e586da6c070058cd813002399}


Get the value of the accumulator. 



Definition at line 199 of file count\_\-value.hh.

