Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
A processing pipeline that applies filters to items. More...
#include <pipeline.h>
Public Member Functions | |
__TBB_EXPORTED_METHOD | pipeline () |
Construct empty pipeline. More... | |
virtual __TBB_EXPORTED_METHOD | ~pipeline () |
void __TBB_EXPORTED_METHOD | add_filter (filter &filter_) |
Add filter to end of pipeline. More... | |
void __TBB_EXPORTED_METHOD | run (size_t max_number_of_live_tokens) |
Run the pipeline to completion. More... | |
void __TBB_EXPORTED_METHOD | run (size_t max_number_of_live_tokens, tbb::task_group_context &context) |
Run the pipeline to completion with user-supplied context. More... | |
void __TBB_EXPORTED_METHOD | clear () |
Remove all filters from the pipeline. More... | |
Private Member Functions | |
void | remove_filter (filter &filter_) |
Remove filter from pipeline. More... | |
void __TBB_EXPORTED_METHOD | inject_token (task &self) |
Not used, but retained to satisfy old export files. More... | |
void | clear_filters () |
Does clean up if pipeline is cancelled or exception occurred. More... | |
Private Attributes | |
filter * | filter_list |
Pointer to first filter in the pipeline. More... | |
filter * | filter_end |
Pointer to location where address of next filter to be added should be stored. More... | |
task * | end_counter |
task who's reference count is used to determine when all stages are done. More... | |
atomic< internal::Token > | input_tokens |
Number of idle tokens waiting for input stage. More... | |
atomic< internal::Token > | token_counter |
Global counter of tokens. More... | |
bool | end_of_input |
False until fetch_input returns NULL. More... | |
bool | has_thread_bound_filters |
True if the pipeline contains a thread-bound filter; false otherwise. More... | |
Friends | |
class | internal::stage_task |
class | internal::pipeline_root_task |
class | filter |
class | thread_bound_filter |
class | internal::pipeline_cleaner |
class | tbb::interface6::internal::pipeline_proxy |
A processing pipeline that applies filters to items.
Definition at line 236 of file pipeline.h.
tbb::pipeline::pipeline | ( | ) |
Construct empty pipeline.
Definition at line 535 of file pipeline.cpp.
References input_tokens, and token_counter.
|
virtual |
Though the current implementation declares the destructor virtual, do not rely on this detail. The virtualness is deprecated and may disappear in future versions of TBB.
Definition at line 546 of file pipeline.cpp.
References clear().
Add filter to end of pipeline.
Definition at line 569 of file pipeline.cpp.
References __TBB_ASSERT, __TBB_PIPELINE_VERSION, end_counter, filter_end, filter_list, has_thread_bound_filters, tbb::filter::is_bound(), tbb::filter::is_ordered(), tbb::filter::is_serial(), tbb::filter::my_filter_mode, tbb::filter::my_input_buffer, tbb::filter::my_pipeline, tbb::filter::next_filter_in_pipeline, tbb::filter::not_in_pipeline(), tbb::filter::object_may_be_null(), tbb::filter::prev_filter_in_pipeline, and tbb::filter::version_mask.
void tbb::pipeline::clear | ( | ) |
Remove all filters from the pipeline.
Definition at line 550 of file pipeline.cpp.
References __TBB_PIPELINE_VERSION, filter_end, filter_list, tbb::filter::my_input_buffer, tbb::filter::next_filter_in_pipeline, tbb::filter::not_in_pipeline(), and tbb::filter::version_mask.
Referenced by ~pipeline().
|
private |
Does clean up if pipeline is cancelled or exception occurred.
Referenced by tbb::internal::pipeline_cleaner::~pipeline_cleaner().
Not used, but retained to satisfy old export files.
Definition at line 521 of file pipeline.cpp.
References __TBB_ASSERT.
Remove filter from pipeline.
Definition at line 620 of file pipeline.cpp.
References __TBB_ASSERT, __TBB_PIPELINE_VERSION, end_counter, filter_end, filter_list, tbb::filter::my_filter_mode, tbb::filter::my_input_buffer, tbb::filter::my_pipeline, tbb::filter::next_filter_in_pipeline, tbb::filter::next_segment, tbb::filter::not_in_pipeline(), tbb::filter::prev_filter_in_pipeline, and tbb::filter::version_mask.
Referenced by tbb::filter::~filter().
void tbb::pipeline::run | ( | size_t | max_number_of_live_tokens | ) |
Run the pipeline to completion.
Definition at line 646 of file pipeline.cpp.
References __TBB_ASSERT, tbb::task::allocate_root(), end_counter, end_of_input, filter_list, has_thread_bound_filters, input_tokens, internal::pipeline_cleaner, internal::pipeline_root_task, tbb::filter::is_bound(), tbb::filter::my_input_buffer, tbb::filter::next_filter_in_pipeline, and tbb::task::spawn_root_and_wait().
void __TBB_EXPORTED_METHOD tbb::pipeline::run | ( | size_t | max_number_of_live_tokens, |
tbb::task_group_context & | context | ||
) |
Run the pipeline to completion with user-supplied context.
|
friend |
Definition at line 262 of file pipeline.h.
|
friend |
Definition at line 264 of file pipeline.h.
Referenced by run().
|
friend |
Definition at line 261 of file pipeline.h.
Referenced by run().
|
friend |
Definition at line 260 of file pipeline.h.
|
friend |
Definition at line 265 of file pipeline.h.
|
friend |
Definition at line 263 of file pipeline.h.
|
private |
task who's reference count is used to determine when all stages are done.
Definition at line 274 of file pipeline.h.
Referenced by add_filter(), remove_filter(), run(), and tbb::internal::pipeline_cleaner::~pipeline_cleaner().
|
private |
False until fetch_input returns NULL.
Definition at line 283 of file pipeline.h.
Referenced by tbb::internal::stage_task::execute(), tbb::internal::pipeline_root_task::execute(), tbb::thread_bound_filter::internal_process_item(), run(), and tbb::filter::set_end_of_input().
|
private |
Pointer to location where address of next filter to be added should be stored.
Definition at line 271 of file pipeline.h.
Referenced by add_filter(), clear(), and remove_filter().
|
private |
Pointer to first filter in the pipeline.
Definition at line 268 of file pipeline.h.
Referenced by add_filter(), clear(), tbb::internal::stage_task::execute(), tbb::internal::pipeline_root_task::execute(), tbb::thread_bound_filter::internal_process_item(), tbb::internal::pipeline_root_task::pipeline_root_task(), remove_filter(), tbb::internal::stage_task::reset(), run(), and tbb::interface6::internal::pipeline_proxy::~pipeline_proxy().
|
private |
True if the pipeline contains a thread-bound filter; false otherwise.
Definition at line 286 of file pipeline.h.
Referenced by add_filter(), tbb::internal::stage_task::execute(), and run().
|
private |
Number of idle tokens waiting for input stage.
Definition at line 277 of file pipeline.h.
Referenced by tbb::internal::stage_task::execute(), tbb::internal::pipeline_root_task::execute(), tbb::thread_bound_filter::internal_process_item(), pipeline(), and run().
|
private |
Global counter of tokens.
Definition at line 280 of file pipeline.h.
Referenced by tbb::internal::stage_task::execute(), tbb::internal::pipeline_root_task::execute(), tbb::filter::has_more_work(), tbb::thread_bound_filter::internal_process_item(), and pipeline().