#include <Results.h>
Public Member Functions | |
| EBusReduceResult (T &rhs, const Aggregator &aggregator=Aggregator()) | |
| void | operator= (T &&rhs) |
| void | operator= (const T &rhs) |
| EBusReduceResult & | operator= (const EBusReduceResult &)=delete |
Public Attributes | |
| T & | value |
| Aggregator | unary |
Aggregates results returned by all handlers of an EBus event. Also puts the aggregated value into the input value that is passed by reference. You can use this structure to add results, apply a logical AND to results, and so on.
| T | The output type of the aggregator. |
| Aggregator | A function object that aggregates results. The return type must match T. For examples of function objects that you can use as aggregators, see functional_basic.h. |
The following example replaces the value returned by a handler with the sum of the value and previous handler return values.
The following example determines whether all handlers, including the latest handler, return true. Also replaces the latest handler result with the aggregated result.
|
inlineexplicit |
Creates an instance of the class, sets the reference to the initial value, and sets the function object to use as the aggregator.
| rhs | A reference to the initial value, which new values will be aggregated with. |
| aggregator | A function object to aggregate the values. For examples of function objects that you can use as aggregators, see functional_basic.h. |
|
delete |
Disallows copying an EBusReduceResult object by reference.
|
inline |
Overloads the assignment operator to aggregate a new value with the existing aggregated value. Used only when the return type is const, or const&
|
inline |
Overloads the assignment operator to aggregate a new value with the existing aggregated value using rvalue-ref
| Aggregator AZ::EBusReduceResult< T &, Aggregator >::unary |
The function object that aggregates a new value with an existing value.
| T& AZ::EBusReduceResult< T &, Aggregator >::value |
A reference to the current value, which new values will be aggregated with.