Resilient
|
A detector which detect whether a function returns a specific value. More...
#include <returns.hpp>
Public Member Functions | |
Returns (T &&failureValue) | |
Construct an instance of Returns. More... | |
template<typename Q > | |
returned_failure_t< failure_types > | detect (ICallResult< Q > &result) |
Check whether the result contains the expected value. More... | |
Public Member Functions inherited from resilient::StatelessDetector< Returns< T > > | |
NoState | preRun () |
Does nothing. More... | |
decltype(auto) | postRun (NoState, ICallResult< T > &result) |
Detect failures by invoking the Detector . More... | |
decltype(auto) | postRun (NoState, ICallResult< T > &result) const |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
Returns< T > | returns (T &&value) |
Return an instance of Returns with the provided value. | |
Additional Inherited Members | |
Public Types inherited from resilient::FailureDetectorTag< ErrorReturn > | |
using | failure_types = std::tuple< FailureTypes... > |
Tuple composed of the possible failure types the detector can detect. More... | |
A detector which detect whether a function returns a specific value.
If the detected function returns the specified value then this class returns ErrorReturn
.
T | The type of the value used to compare against the returned value of the function. |
T
can be different from the returned type, as long as they can be compared for equality.
|
inline |
Construct an instance of Returns.
failureValue | The value used to compare against the return value of the function. |
|
inline |
Check whether the result contains the expected value.
Q | The return type of the detected function |
result | The result of invoking the detected function. |
ErrorReturn
if the returned type is equal to the expected type, NoFailure
otherwise.