mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Group: Enable aggregate exception to be passed as ptr
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef MULTI_OPERATION_RESULT_SET_H
|
||||
#define MULTI_OPERATION_RESULT_SET_H
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace sscl {
|
||||
|
||||
/** Plain aggregate for fan-out / fan-in results returned from coroutines. */
|
||||
@@ -24,6 +26,25 @@ struct MultiOperationResultSet
|
||||
unsigned int nFailed;
|
||||
};
|
||||
|
||||
/** Fan-out / fan-in counts plus optional aggregated member failure. */
|
||||
struct MultiOperationResultSetWithException
|
||||
{
|
||||
MultiOperationResultSetWithException() = default;
|
||||
|
||||
MultiOperationResultSetWithException(
|
||||
MultiOperationResultSet resultsIn,
|
||||
std::exception_ptr memberFailureExceptionIn = nullptr)
|
||||
: results(resultsIn),
|
||||
memberFailureException(memberFailureExceptionIn)
|
||||
{}
|
||||
|
||||
bool hasMemberFailure() const
|
||||
{ return memberFailureException != nullptr; }
|
||||
|
||||
MultiOperationResultSet results;
|
||||
std::exception_ptr memberFailureException = nullptr;
|
||||
};
|
||||
|
||||
} // namespace sscl
|
||||
|
||||
#endif // MULTI_OPERATION_RESULT_SET_H
|
||||
|
||||
Reference in New Issue
Block a user