Template Struct result_data¶
Defined in File activities.h
Inheritance Relationships¶
Derived Type¶
public udho::activities::result< SuccessT, FailureT >(Template Struct result)
Struct Documentation¶
-
template<typename
SuccessT, typenameFailureT>
structudho::activities::result_data¶ Contains Copiable Success or Failure data for an activity.
- Template Parameters
SuccessT: success data typeFailureT: failure data type
Subclassed by udho::activities::result< SuccessT, FailureT >
Public Types
-
typedef result_data<SuccessT, FailureT>
self_type¶
Public Functions
-
result_data()¶
-
bool
completed() const¶ either success or failure data set
-
bool
failed() const¶ whether the activity has failed
-
bool
canceled() const¶ check whether the activity has been canceled
-
bool
okay() const¶
-
const success_type &
success_data() const¶ Success data
-
const failure_type &
failure_data() const¶ Failure data
-
template<typename
CallableT>
voidapply(CallableT callback)¶ Apply a callable to the result data which will be invoked exactly once with appropriate arguments. The invocation of the callback depends on the state as shown below.
Incomplete: callback()
Canceled: callback(const SuccessT&, const FailureT&)
Failed: callback(const FailureT&)
Successful: callback(const SuccessT&)
The callback may not have all the overloads.
- Parameters
callback:
Public Members
-
bool
_completed¶
-
bool
_success¶
-
bool
_canceled¶
-
success_type
_sdata¶
-
failure_type
_fdata¶
Protected Functions
-
void
success(const success_type &data)¶ Set Success Data
-
void
failure(const failure_type &data)¶ Set Failure Data
-
void
cancel()¶ mark as canceled