Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface6::internal::concrete_filter< T, U, Body > Class Template Reference

#include <pipeline.h>

Inheritance diagram for tbb::interface6::internal::concrete_filter< T, U, Body >:
Collaboration diagram for tbb::interface6::internal::concrete_filter< T, U, Body >:

Public Member Functions

 concrete_filter (tbb::filter::mode filter_mode, const Body &body)
 
- Public Member Functions inherited from tbb::filter
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 __TBB_EXPORTED_METHOD ~filter ()
 Destroy filter. More...
 

Private Types

typedef token_helper< T, use_allocator< T >::valuet_helper
 
typedef t_helper::pointer t_pointer
 
typedef token_helper< U, use_allocator< U >::valueu_helper
 
typedef u_helper::pointer u_pointer
 

Private Member Functions

voidoperator() (void *input) __TBB_override
 Operate on an item from the input stream, and return item for output stream. More...
 
void finalize (void *input) __TBB_override
 Destroys item if pipeline was cancelled. More...
 

Private Attributes

const Body & my_body
 

Additional Inherited Members

- Public Types inherited from tbb::filter
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 }
 
- Protected Member Functions inherited from tbb::filter
 filter (bool is_serial_)
 
 filter (mode filter_mode)
 
void __TBB_EXPORTED_METHOD set_end_of_input ()
 
- Static Protected Attributes inherited from tbb::filter
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
 

Detailed Description

template<typename T, typename U, typename Body>
class tbb::interface6::internal::concrete_filter< T, U, Body >

Definition at line 312 of file pipeline.h.

Member Typedef Documentation

◆ t_helper

template<typename T , typename U , typename Body >
typedef token_helper<T,use_allocator<T>::value> tbb::interface6::internal::concrete_filter< T, U, Body >::t_helper
private

Definition at line 431 of file pipeline.h.

◆ t_pointer

template<typename T , typename U , typename Body >
typedef t_helper::pointer tbb::interface6::internal::concrete_filter< T, U, Body >::t_pointer
private

Definition at line 432 of file pipeline.h.

◆ u_helper

template<typename T , typename U , typename Body >
typedef token_helper<U,use_allocator<U>::value> tbb::interface6::internal::concrete_filter< T, U, Body >::u_helper
private

Definition at line 433 of file pipeline.h.

◆ u_pointer

template<typename T , typename U , typename Body >
typedef u_helper::pointer tbb::interface6::internal::concrete_filter< T, U, Body >::u_pointer
private

Definition at line 434 of file pipeline.h.

Constructor & Destructor Documentation

◆ concrete_filter()

template<typename T , typename U , typename Body >
tbb::interface6::internal::concrete_filter< T, U, Body >::concrete_filter ( tbb::filter::mode  filter_mode,
const Body &  body 
)
inline

Definition at line 449 of file pipeline.h.

449 : filter(filter_mode), my_body(body) {}
filter(bool is_serial_)
Definition: pipeline.h:105

Member Function Documentation

◆ finalize()

template<typename T , typename U , typename Body >
void tbb::interface6::internal::concrete_filter< T, U, Body >::finalize ( void )
inlineprivatevirtual

Destroys item if pipeline was cancelled.

Required to prevent memory leaks. Note it can be called concurrently even for serial filters.

Reimplemented from tbb::filter.

Definition at line 443 of file pipeline.h.

443  {
444  t_pointer temp_input = t_helper::cast_from_void_ptr(input);
445  t_helper::destroy_token(temp_input);
446  }

◆ operator()()

template<typename T , typename U , typename Body >
void* tbb::interface6::internal::concrete_filter< T, U, Body >::operator() ( void item)
inlineprivatevirtual

Operate on an item from the input stream, and return item for output stream.

Returns NULL if filter is a sink.

Implements tbb::filter.

Definition at line 436 of file pipeline.h.

436  {
437  t_pointer temp_input = t_helper::cast_from_void_ptr(input);
438  u_pointer output_u = u_helper::create_token(my_body(tbb::internal::move(t_helper::token(temp_input))));
439  t_helper::destroy_token(temp_input);
440  return u_helper::cast_to_void_ptr(output_u);
441  }
void move(tbb_thread &t1, tbb_thread &t2)
Definition: tbb_thread.h:319

References tbb::move(), and tbb::interface6::internal::concrete_filter< T, U, Body >::my_body.

Here is the call graph for this function:

Member Data Documentation

◆ my_body


The documentation for this class was generated from the following file:

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.