\hypertarget{a01994}{}\doxysection{AAX\+\_\+\+Aggregate\+Result Class Reference}
\label{a01994}\index{AAX\_AggregateResult@{AAX\_AggregateResult}}


{\ttfamily \#include $<$AAX\+\_\+\+Exception.\+h$>$}



\doxysubsection{Description}
RAII failure count convenience class for use with \mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\+\_\+\+CAPTURE()}} or \mbox{\hyperlink{a00620_a078be92d3d19a5a4b3da2b55ae5ac1c9}{AAX\+\_\+\+CAPTURE\+\_\+\+MULT()}}

Pass this object as the first argument in a series of \mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\+\_\+\+CAPTURE()}} calls to count the number of failures that occur and to re-\/throw the last error if zero of the attempted calls succeed.


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{//\ example\ A:\ throw\ if\ all\ operations\ fail}}
\DoxyCodeLine{\mbox{\hyperlink{a01994}{AAX\_AggregateResult}}\ agg;}
\DoxyCodeLine{\mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\_CAPTURE}}(\ agg,\ RegisterThingA();\ );}
\DoxyCodeLine{\mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\_CAPTURE}}(\ agg,\ RegisterThingB();\ );}
\DoxyCodeLine{\mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\_CAPTURE}}(\ agg,\ RegisterThingC();\ );}

\end{DoxyCode}


In this example, when {\ttfamily agg} goes out of scope it checks whether any of A, B, or C succeeded. If none succeeded then the last error that was encountered is raised via an \mbox{\hyperlink{a01990_a36fd71afc6d62993c1dd96e1ca9fcc0e}{AAX\+\_\+\+Checked\+Result\+::\+Exception}}. If at least one of the calls succeeded then any failures are swallowed and execution continues as normal. This approach can be useful in cases where you want to run every operation in a group and you only want a failure to be returned if all of the operations failed.


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{//\ example\ B:\ throw\ if\ any\ operation\ fails}}
\DoxyCodeLine{\mbox{\hyperlink{a01994}{AAX\_AggregateResult}}\ agg;}
\DoxyCodeLine{\mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\_CAPTURE}}(\ agg,\ ImportantOperationW();\ );}
\DoxyCodeLine{\mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\_CAPTURE}}(\ agg,\ ImportantOperationX();\ );}
\DoxyCodeLine{\mbox{\hyperlink{a00620_af9972551e4546e894010f99eade68c94}{AAX\_CAPTURE}}(\ agg,\ ImportantOperationY();\ );}
\DoxyCodeLine{\mbox{\hyperlink{a01990}{AAX\_CheckedResult}}\ err\ =\ agg;}

\end{DoxyCode}


In this example, the last error encountered by {\ttfamily agg} is converted to an \mbox{\hyperlink{a01990}{AAX\+\_\+\+Checked\+Result}}. This will result in an \mbox{\hyperlink{a01990_a36fd71afc6d62993c1dd96e1ca9fcc0e}{AAX\+\_\+\+Checked\+Result\+::\+Exception}} even if at least one of the attempted operations succeeded. This approach can be useful in cases where you want all operations in a group to be executed before an error is raised for any failure within the group. \doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{a01994_a8534104d582e40a0e2e1aab75dc8528e}{AAX\+\_\+\+Aggregate\+Result}} ()=default
\item 
\mbox{\hyperlink{a01994_a09e9058ca4ec5df47741cef7e44cf165}{$\sim$\+AAX\+\_\+\+Aggregate\+Result}} ()
\item 
\mbox{\hyperlink{a01994}{AAX\+\_\+\+Aggregate\+Result}} \& \mbox{\hyperlink{a01994_a19c8acd13ef660d9c2f1f6609ec96cfc}{operator=}} (\mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}} in\+Result)
\begin{DoxyCompactList}\small\item\em Overloaded {\ttfamily \mbox{\hyperlink{a01994_a19c8acd13ef660d9c2f1f6609ec96cfc}{operator=()}}} for conversion from \mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{a01994_a22f5af0ad6bcbd507aa976bbc6347d4e}{operator AAX\+\_\+\+Result}} ()
\begin{DoxyCompactList}\small\item\em Implicit conversion to AAX\+\_\+\+Result clears the state. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{a01994_a33d04a772b49de8c5413086bcd426c07}{Check}} () const
\item 
void \mbox{\hyperlink{a01994_a45d3ebe7f67b352af2773396eac0ba14}{Clear}} ()
\item 
\mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}} \mbox{\hyperlink{a01994_a0013779e238ac59fd554aa2315658a33}{Last\+Failure}} () const
\item 
int \mbox{\hyperlink{a01994_af566e9d83e13f3df53873e112b90a6d1}{Num\+Failed}} () const
\item 
int \mbox{\hyperlink{a01994_a4b3ef5ae845c708b2f5d4e94f22fbfee}{Num\+Succeeded}} () const
\item 
int \mbox{\hyperlink{a01994_aff31a39e4489a273a28efa37e4aac781}{Num\+Attempted}} () const
\end{DoxyCompactItemize}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{a01994_a8534104d582e40a0e2e1aab75dc8528e}\label{a01994_a8534104d582e40a0e2e1aab75dc8528e}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{AAX\_AggregateResult()}{AAX\_AggregateResult()}}
{\footnotesize\ttfamily AAX\+\_\+\+Aggregate\+Result\+::\+AAX\+\_\+\+Aggregate\+Result (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [default]}}

\mbox{\Hypertarget{a01994_a09e9058ca4ec5df47741cef7e44cf165}\label{a01994_a09e9058ca4ec5df47741cef7e44cf165}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!````~AAX\_AggregateResult@{$\sim$AAX\_AggregateResult}}
\index{````~AAX\_AggregateResult@{$\sim$AAX\_AggregateResult}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{$\sim$AAX\_AggregateResult()}{~AAX\_AggregateResult()}}
{\footnotesize\ttfamily AAX\+\_\+\+Aggregate\+Result\+::$\sim$\+AAX\+\_\+\+Aggregate\+Result (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References \mbox{\hyperlink{a01994_a33d04a772b49de8c5413086bcd426c07}{Check()}}.

Here is the call graph for this function\+:
% FIG 0


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{a01994_a19c8acd13ef660d9c2f1f6609ec96cfc}\label{a01994_a19c8acd13ef660d9c2f1f6609ec96cfc}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!operator=@{operator=}}
\index{operator=@{operator=}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}}
{\footnotesize\ttfamily \mbox{\hyperlink{a01994}{AAX\+\_\+\+Aggregate\+Result}} \& AAX\+\_\+\+Aggregate\+Result\+::operator= (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}}}]{in\+Result }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Overloaded {\ttfamily \mbox{\hyperlink{a01994_a19c8acd13ef660d9c2f1f6609ec96cfc}{operator=()}}} for conversion from \mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}}. 



References \mbox{\hyperlink{a00539_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\+\_\+\+SUCCESS}}.

\mbox{\Hypertarget{a01994_a22f5af0ad6bcbd507aa976bbc6347d4e}\label{a01994_a22f5af0ad6bcbd507aa976bbc6347d4e}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!operator AAX\_Result@{operator AAX\_Result}}
\index{operator AAX\_Result@{operator AAX\_Result}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{operator AAX\_Result()}{operator AAX\_Result()}}
{\footnotesize\ttfamily AAX\+\_\+\+Aggregate\+Result\+::operator \mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Implicit conversion to AAX\+\_\+\+Result clears the state. 



References \mbox{\hyperlink{a01994_a45d3ebe7f67b352af2773396eac0ba14}{Clear()}}, and \mbox{\hyperlink{a01994_a0013779e238ac59fd554aa2315658a33}{Last\+Failure()}}.

Here is the call graph for this function\+:
% FIG 1
\mbox{\Hypertarget{a01994_a33d04a772b49de8c5413086bcd426c07}\label{a01994_a33d04a772b49de8c5413086bcd426c07}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!Check@{Check}}
\index{Check@{Check}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{Check()}{Check()}}
{\footnotesize\ttfamily void AAX\+\_\+\+Aggregate\+Result\+::\+Check (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Referenced by \mbox{\hyperlink{a01994_a09e9058ca4ec5df47741cef7e44cf165}{$\sim$\+AAX\+\_\+\+Aggregate\+Result()}}.

Here is the caller graph for this function\+:
% FIG 2
\mbox{\Hypertarget{a01994_a45d3ebe7f67b352af2773396eac0ba14}\label{a01994_a45d3ebe7f67b352af2773396eac0ba14}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!Clear@{Clear}}
\index{Clear@{Clear}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{Clear()}{Clear()}}
{\footnotesize\ttfamily void AAX\+\_\+\+Aggregate\+Result\+::\+Clear (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



References \mbox{\hyperlink{a00539_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\+\_\+\+SUCCESS}}.



Referenced by \mbox{\hyperlink{a01994_a22f5af0ad6bcbd507aa976bbc6347d4e}{operator AAX\+\_\+\+Result()}}.

Here is the caller graph for this function\+:
% FIG 3
\mbox{\Hypertarget{a01994_a0013779e238ac59fd554aa2315658a33}\label{a01994_a0013779e238ac59fd554aa2315658a33}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!LastFailure@{LastFailure}}
\index{LastFailure@{LastFailure}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{LastFailure()}{LastFailure()}}
{\footnotesize\ttfamily \mbox{\hyperlink{a00542_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\+\_\+\+Result}} AAX\+\_\+\+Aggregate\+Result\+::\+Last\+Failure (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Referenced by \mbox{\hyperlink{a01994_a22f5af0ad6bcbd507aa976bbc6347d4e}{operator AAX\+\_\+\+Result()}}.

Here is the caller graph for this function\+:
% FIG 4
\mbox{\Hypertarget{a01994_af566e9d83e13f3df53873e112b90a6d1}\label{a01994_af566e9d83e13f3df53873e112b90a6d1}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!NumFailed@{NumFailed}}
\index{NumFailed@{NumFailed}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{NumFailed()}{NumFailed()}}
{\footnotesize\ttfamily int AAX\+\_\+\+Aggregate\+Result\+::\+Num\+Failed (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{a01994_a4b3ef5ae845c708b2f5d4e94f22fbfee}\label{a01994_a4b3ef5ae845c708b2f5d4e94f22fbfee}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!NumSucceeded@{NumSucceeded}}
\index{NumSucceeded@{NumSucceeded}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{NumSucceeded()}{NumSucceeded()}}
{\footnotesize\ttfamily int AAX\+\_\+\+Aggregate\+Result\+::\+Num\+Succeeded (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{a01994_aff31a39e4489a273a28efa37e4aac781}\label{a01994_aff31a39e4489a273a28efa37e4aac781}} 
\index{AAX\_AggregateResult@{AAX\_AggregateResult}!NumAttempted@{NumAttempted}}
\index{NumAttempted@{NumAttempted}!AAX\_AggregateResult@{AAX\_AggregateResult}}
\doxysubsubsection{\texorpdfstring{NumAttempted()}{NumAttempted()}}
{\footnotesize\ttfamily int AAX\+\_\+\+Aggregate\+Result\+::\+Num\+Attempted (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{a00620}{AAX\+\_\+\+Exception.\+h}}\end{DoxyCompactItemize}
