Template Class analyzer¶
Defined in File activities.h
Class Documentation¶
-
template<typename
ActivityT>
classudho::activities::analyzer¶ - An analyzer can be applied on an activity to analyze its result data. The analyzer can be equipped with callbackss to handle different result states.
const udho::accessor<A1, A2i, A3i>& d; d.apply<A1>(udho::activities::analyzer<A1>() .canceled([](const A1SData& s, const A1FData& f){ std::cout << "CANCELED" << std::endl; }) .incomplete([](){ std::cout << "INCOMPLETE" << std::endl; }) .failure([](const A1FData& f){ std::cout << "FAILED" << std::endl; }) .success([](const A1SData& s){ std::cout << "SUCCESS" << std::endl; }) );
- See
state
Public Functions
-
void
operator()()¶
-
void
operator()(const success_type &s, const failure_type &f)¶
-
void
operator()(const failure_type &f)¶
-
void
operator()(const success_type &s)¶
-
self_type &
incomplete(incomplete_ftor_type ftor)¶ If the activity is incomplete and an incomplete callback is set then the incomplete callback is invoked if any of the following holds
there is no error callback
there is an error callback but the task has not been canceled
there is an error callback and the task has been canceled (
- See
operator()(const success_type&, const failure_type&))
-
self_type &
canceled(cancelation_ftor_type ftor)¶ If the activity is canceled and a canceled callback is set then the canceled callback is invoked if the following holds
there is no error callback
-
self_type &
error(success_ftor_type ftor)¶ The error callback is called if the subtask has not failed but has been canceled (through cancel_if) Once the error callback is set failure and incomplete callbacks are invoked differently The error callback is called if the following holds
there is an error callback set and the activity is canceled and the activity has not failed
-
self_type &
failure(failure_ftor_type ftor)¶ If the activity has failed and afailure callback is set then the failure callback is called if any of the following holds
there is no error callback
there is an error callback set and the activity is canceled
there is an error callback set and the activity is not canceled
-
self_type &
success(success_ftor_type ftor)¶ If the activity is complete and neither failed nor canceled then the success callback is called if a a success callback is set
-
activity_state
apply()¶
-
bool
successful()¶