Template Struct combinator

Inheritance Relationships

Base Type

Struct Documentation

template<typename NextT, typename ...DependenciesT>
struct udho::activities::combinator : public udho::activities::junction<DependenciesT::result_type>

A combinator combines multiple activities and proceeds towards the next activity

Template Parameters
  • NextT: next activity

  • DependenciesT: dependencies

Public Types

typedef std::shared_ptr<NextT> next_type
typedef boost::signals2::signal<void(NextT&)> signal_type

Public Functions

combinator(next_type &next)
template<typename U>
void operator()(const U &u)

whenever a subtask finishes the operator() of the combinator is called. which doesn’t start the next subtask untill all the dependencies have completed. Before starting the next activity the next activity is prepared if any preparator is passed through the prepare() function

void cancel()
void propagate()
template<typename PreparatorT>
void prepare(PreparatorT prep)

set a preparator callback which will be called with a reference to teh next activity. The preparator callback is supposed to prepare the next activity by using the data callected till that time.

Public Members

next_type _next
std::atomic<std::size_t> _counter
std::mutex _mutex
signal_type _preparators
std::atomic<bool> _canceled