Template Struct subtask< ActivityT >

Struct Documentation

template<typename ActivityT>
struct udho::activities::subtask<ActivityT>

Spetialization for the root subtask in the task graph

Template Parameters
  • ActivityT: The activity

Public Types

typedef ActivityT activity_type
typedef subtask<ActivityT> self_type

Public Functions

subtask(const self_type &other)
std::shared_ptr<activity_type> activity()
template<typename V, typename ...DependenciesV>
self_type &done(subtask<V, DependenciesV...> &next)

execute task next after the current one

Parameters
  • next: the next subtask

template<typename ...U>
void operator()(U&&... u)

calls the operator()() of the activity and starts executing the graph

self_type &required(bool flag)

Set required flag on or off. If a required subtask fails then all intermediate subtask that depend on it fails and the final callback is called immediately. By default all subtasks are required

self_type &cancel_if(typename activity_type::cancel_if_ftor cancelor)

Force cancelation of the activity even after it is successful to stop propagating to the next activities

Parameters
  • f: callback which should return true to signal cancelation

std::shared_ptr<activity_type> operator->()

returns the shared pointer to the actiivity

template<typename FunctionT>
self_type &if_errored(FunctionT ftor)

abort if canceled if ftor returns false. f will be called with the success if it has been canceled due to error

template<typename FunctionT>
self_type &if_failed(FunctionT ftor)

abort if canceled if ftor returns false. f will be called with the failue data if it has been canceled due to failure

template<typename FunctionT>
self_type &if_canceled(FunctionT ftor)

Public Static Functions

template<typename CollectorT, typename ...U>
self_type with(CollectorT collector, U&&... u)

Arguments for the constructor of the Activity

Friends

friend struct subtask