Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
A stage in a pipeline served by a user thread. More...
#include <pipeline.h>
Public Types | |
enum | result_type { success, item_not_available, end_of_stream } |
![]() | |
enum | mode { parallel = current_version | filter_is_out_of_order, serial_in_order = current_version | filter_is_serial, serial_out_of_order = current_version | filter_is_serial | filter_is_out_of_order, serial = serial_in_order } |
Public Member Functions | |
result_type __TBB_EXPORTED_METHOD | try_process_item () |
If a data item is available, invoke operator() on that item. More... | |
result_type __TBB_EXPORTED_METHOD | process_item () |
Wait until a data item becomes available, and invoke operator() on that item. More... | |
![]() | |
bool | is_serial () const |
True if filter is serial. More... | |
bool | is_ordered () const |
True if filter must receive stream in order. More... | |
bool | is_bound () const |
True if filter is thread-bound. More... | |
bool | object_may_be_null () |
true if an input filter can emit null More... | |
virtual void * | operator() (void *item)=0 |
Operate on an item from the input stream, and return item for output stream. More... | |
virtual __TBB_EXPORTED_METHOD | ~filter () |
Destroy filter. More... | |
virtual void | finalize (void *) |
Destroys item if pipeline was cancelled. More... | |
Protected Member Functions | |
thread_bound_filter (mode filter_mode) | |
![]() | |
filter (bool is_serial_) | |
filter (mode filter_mode) | |
void __TBB_EXPORTED_METHOD | set_end_of_input () |
Private Member Functions | |
result_type | internal_process_item (bool is_blocking) |
Internal routine for item processing. More... | |
Additional Inherited Members | |
![]() | |
static const unsigned char | filter_is_serial = 0x1 |
The lowest bit 0 is for parallel vs. serial. More... | |
static const unsigned char | filter_is_out_of_order = 0x1<<4 |
4th bit distinguishes ordered vs unordered filters. More... | |
static const unsigned char | filter_is_bound = 0x1<<5 |
5th bit distinguishes thread-bound and regular filters. More... | |
static const unsigned char | filter_may_emit_null = 0x1<<6 |
6th bit marks input filters emitting small objects More... | |
static const unsigned char | exact_exception_propagation |
7th bit defines exception propagation mode expected by the application. More... | |
static const unsigned char | current_version = __TBB_PIPELINE_VERSION(5) |
static const unsigned char | version_mask = 0x7<<1 |
A stage in a pipeline served by a user thread.
Definition at line 196 of file pipeline.h.
Enumerator | |
---|---|
success | |
item_not_available | |
end_of_stream |
Definition at line 198 of file pipeline.h.
|
inlineexplicitprotected |
Definition at line 207 of file pipeline.h.
References __TBB_ASSERT, and tbb::filter::filter_is_serial.
|
private |
Internal routine for item processing.
Definition at line 727 of file pipeline.cpp.
References __TBB_ASSERT, tbb::internal::task_info::my_object, tbb::internal::task_info::my_token, tbb::internal::task_info::my_token_ready, and tbb::internal::task_info::reset().
thread_bound_filter::result_type tbb::thread_bound_filter::process_item | ( | ) |
Wait until a data item becomes available, and invoke operator() on that item.
This interface is blocking. Returns 'success' if an item was processed. Returns 'end_of_stream' if there are no more items to process. Never returns 'item_not_available', as it blocks until another return condition applies.
Definition at line 719 of file pipeline.cpp.
thread_bound_filter::result_type tbb::thread_bound_filter::try_process_item | ( | ) |
If a data item is available, invoke operator() on that item.
This interface is non-blocking. Returns 'success' if an item was processed. Returns 'item_not_available' if no item can be processed now but more may arrive in the future, or if token limit is reached. Returns 'end_of_stream' if there are no more items to process.
Definition at line 723 of file pipeline.cpp.