Template Struct result

Inheritance Relationships

Base Type

Struct Documentation

template<typename SuccessT, typename FailureT>
struct udho::activities::result : public udho::activities::result_data<SuccessT, FailureT>

Completion handler for an activity.

Template Parameters
  • SuccessT: success data associated with the activity

  • FailureT: failure data associated with the activity

Public Types

typedef result_data<SuccessT, FailureT> data_type
typedef accessor<data_type> accessor_type
typedef data_type::success_type success_type
typedef data_type::failure_type failure_type
typedef boost::signals2::signal<void(const data_type&)> signal_type
typedef boost::signals2::signal<void()> cancelation_signal_type
typedef boost::function<bool(const success_type&)> cancel_if_ftor
typedef boost::function<bool(const success_type&)> abort_error_ftor
typedef boost::function<bool(const failure_type&)> abort_failure_ftor

Public Functions

template<typename StoreT>
result(StoreT &store)

Parameters
  • store: collector

template<typename CombinatorT>
void done(CombinatorT cmb)

attach another subtask as done callback which will be executed once this subtask finishes

Parameters
  • cmb: next subtask

void required(bool flag)

mark the activity as required or optional

Parameters
  • flag:

void cancel_if(cancel_if_ftor f)

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

void if_errored(abort_error_ftor ftor)
void if_failed(abort_failure_ftor ftor)

Public Members

accessor_type _shadow
signal_type _signal
bool _required
cancelation_signal_type _cancelation_signals
cancel_if_ftor _cancel_if
abort_error_ftor _abort_error
abort_failure_ftor _abort_failure

Protected Functions

void success(const success_type &data)

signal successful completion of the activity with success data of type SuccessT

Parameters
  • data: success data

void failure(const failure_type &data)

signal failed completion of the activity with failure data of type FailureT

Parameters
  • data: failure data

Friends

friend struct combinator