#include <parallel_while.h>
Public Types | |
typedef Body::argument_type | value_type |
Type of items. | |
Public Member Functions | |
parallel_while () | |
Construct empty non-running parallel while. | |
~parallel_while () | |
Destructor cleans up data members before returning. | |
template<typename Stream > | |
void | run (Stream &stream, const Body &body) |
Apply body.apply to each item in the stream. | |
void | add (const value_type &item) |
Add a work item while running. |
Parallel iteration over a stream, with optional addition of more work. The Body b has the requirement:
"b(v)"
"b.argument_type"
where v is an argument_type
void tbb::parallel_while< Body >::add | ( | const value_type & | item | ) | [inline] |
Add a work item while running.
Should be executed only by body.apply or a thread spawned therefrom.
References tbb::task::self().
void tbb::parallel_while< Body >::run | ( | Stream & | stream, | |
const Body & | body | |||
) | [inline] |
Apply body.apply to each item in the stream.
A Stream s has the requirements
"S::value_type"
s.pop_if_present(value) is convertible to bool
References tbb::task::allocate_child(), tbb::task::allocate_root(), tbb::task::destroy(), tbb::task::set_ref_count(), and tbb::task::spawn_and_wait_for_all().