\hypertarget{a08272}{}\section{A\+CG\+:\+:Progress Class Reference}
\label{a08272}\index{A\+C\+G\+::\+Progress@{A\+C\+G\+::\+Progress}}


{\ttfamily \#include $<$Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+Utils/\+Progress.\+hh$>$}

\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{a08276}{Child\+Record}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a08272_ae50edf7a6bdf07ad47713caf9aab6084}\label{a08272_ae50edf7a6bdf07ad47713caf9aab6084}} 
{\bfseries Progress} (double max\+Progress=1.\+0)
\item 
\mbox{\Hypertarget{a08272_ab4168b50fdd9dfa7d0b02e5d4217605d}\label{a08272_ab4168b50fdd9dfa7d0b02e5d4217605d}} 
void {\bfseries set\+Max\+Progress} (double value)
\item 
double \hyperlink{a08272_a2f89fe6e823e6918069a900debbbfdbd}{get\+Normalized\+Progress} () const
\item 
\mbox{\Hypertarget{a08272_ab46f5c40fbbb81427f9275a75d05f8ad}\label{a08272_ab46f5c40fbbb81427f9275a75d05f8ad}} 
double {\bfseries get\+Progress} () const
\item 
void \hyperlink{a08272_a6a6872bca10bf8eea84e6fd3729b07f0}{add\+Sub\+Progress} (\hyperlink{a08272}{Progress} $\ast$progress, double contribution)
\item 
\mbox{\Hypertarget{a08272_ae8cf8b84fb711d6291bf65fd632d5e88}\label{a08272_ae8cf8b84fb711d6291bf65fd632d5e88}} 
void {\bfseries increment} (double amount)
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a08272_a220e4a1e8ff4fe15ae7ce5c3069ee754}\label{a08272_a220e4a1e8ff4fe15ae7ce5c3069ee754}} 
void {\bfseries on\+Child\+Progress} (\hyperlink{a08272}{Progress} $\ast$)
\item 
\mbox{\Hypertarget{a08272_a15c74eaeb3612677ff8acac42cd87a7b}\label{a08272_a15c74eaeb3612677ff8acac42cd87a7b}} 
void {\bfseries progress\+Changed} ()
\item 
\mbox{\Hypertarget{a08272_aede5010c680f62793ba2c5ec5be40dd2}\label{a08272_aede5010c680f62793ba2c5ec5be40dd2}} 
void {\bfseries update\+Dialog} ()
\item 
\mbox{\Hypertarget{a08272_a34f99bb36362eb2ffe4d57034a8f65bb}\label{a08272_a34f99bb36362eb2ffe4d57034a8f65bb}} 
void {\bfseries child\+Goes\+Bye} (\hyperlink{a08272}{Progress} $\ast$child)
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a08272_a79566210d031602e724292cdb0966020}\label{a08272_a79566210d031602e724292cdb0966020}} 
\hyperlink{a08272}{Progress} $\ast$ {\bfseries parent}
\item 
\mbox{\Hypertarget{a08272_a9a90f5199950e933be4288e1760d0133}\label{a08272_a9a90f5199950e933be4288e1760d0133}} 
std\+::set$<$ \hyperlink{a08276}{Child\+Record} $>$ {\bfseries children}
\item 
\mbox{\Hypertarget{a08272_af1ded8a3f076ed826285131fa271ece1}\label{a08272_af1ded8a3f076ed826285131fa271ece1}} 
double {\bfseries max\+Progress}
\item 
\mbox{\Hypertarget{a08272_affeff2d3a0f891b9263099c883d27e6f}\label{a08272_affeff2d3a0f891b9263099c883d27e6f}} 
double {\bfseries current\+Progress}
\item 
\mbox{\Hypertarget{a08272_ac769c94959eab26566b34dda2e41723b}\label{a08272_ac769c94959eab26566b34dda2e41723b}} 
\begin{tabbing}
xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill
union \{\\
\>void $\ast$ {\bfseries dialog\_padding}\\
\}; \\

\end{tabbing}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a08272_a11746b6c13c444beca3965699b5f35ac}\label{a08272_a11746b6c13c444beca3965699b5f35ac}} 
{\bfseries Progress} (const \hyperlink{a08272}{Progress} \&rhs)
\item 
\mbox{\Hypertarget{a08272_ad14273fc0a61b9cec92f5b8085470e39}\label{a08272_ad14273fc0a61b9cec92f5b8085470e39}} 
\hyperlink{a08272}{Progress} \& {\bfseries operator=} (const \hyperlink{a08272}{Progress} \&rhs)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Keep track of the progress of tasks and subtasks.

Not thread safe. Could easily be made thread safe, though. See \char`\"{}\+Thread safety\char`\"{} comments in the source code.

Usage Example\+: \begin{DoxyVerb}Progress p1(5.0);
p1.increment(1.0);
assert(p1.getNormalizedProgress() == 0.2);
p1.increment(4.0);
assert(p1.getNormalizedProgress() == 1.0);

Progress p2(10.0);
{
    Progress p2_1(10.0);
    p2.addSubProgress(&p2_1, 5.0);
    assert(p2.getNormalizedProgress() == 0.0);
    p2_1.increment(5.0);
    assert(p2_1.getNormalizedProgress() == 0.5);
    assert(p2.getNormalizedProgress() == 0.25);
}

// When the sub progress gets destroyed, the parent
// assumes it is completed.
assert(p2.getNormalizedProgress() == 0.5);\end{DoxyVerb}
 

Definition at line 84 of file Progress.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{a08272_a6a6872bca10bf8eea84e6fd3729b07f0}\label{a08272_a6a6872bca10bf8eea84e6fd3729b07f0}} 
\index{A\+C\+G\+::\+Progress@{A\+C\+G\+::\+Progress}!add\+Sub\+Progress@{add\+Sub\+Progress}}
\index{add\+Sub\+Progress@{add\+Sub\+Progress}!A\+C\+G\+::\+Progress@{A\+C\+G\+::\+Progress}}
\subsubsection{\texorpdfstring{add\+Sub\+Progress()}{addSubProgress()}}
{\footnotesize\ttfamily void A\+C\+G\+::\+Progress\+::add\+Sub\+Progress (\begin{DoxyParamCaption}\item[{\hyperlink{a08272}{Progress} $\ast$}]{progress,  }\item[{double}]{contribution }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Does N\+OT take ownership of the supplied \hyperlink{a08272}{Progress} object. 

Definition at line 128 of file Progress.\+hh.

\mbox{\Hypertarget{a08272_a2f89fe6e823e6918069a900debbbfdbd}\label{a08272_a2f89fe6e823e6918069a900debbbfdbd}} 
\index{A\+C\+G\+::\+Progress@{A\+C\+G\+::\+Progress}!get\+Normalized\+Progress@{get\+Normalized\+Progress}}
\index{get\+Normalized\+Progress@{get\+Normalized\+Progress}!A\+C\+G\+::\+Progress@{A\+C\+G\+::\+Progress}}
\subsubsection{\texorpdfstring{get\+Normalized\+Progress()}{getNormalizedProgress()}}
{\footnotesize\ttfamily double A\+C\+G\+::\+Progress\+::get\+Normalized\+Progress (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\begin{DoxyReturn}{Returns}
A number in the interval \mbox{[}0, 1\mbox{]}, 0 being no progress at all and 1 being a finished job. 
\end{DoxyReturn}


Definition at line 108 of file Progress.\+hh.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+Utils/Progress.\+hh\end{DoxyCompactItemize}
