Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare > Class Template Reference

Body class used to test if elements in a range are presorted. More...

#include <parallel_sort.h>

Inheritance diagram for tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >:
Collaboration diagram for tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >:

Public Member Functions

 quick_sort_pretest_body (const Compare &_comp)
 
void operator() (const blocked_range< RandomAccessIterator > &range) const
 

Private Attributes

const Compare & comp
 

Additional Inherited Members

- Private Member Functions inherited from tbb::internal::no_assign
void operator= (const no_assign &)=delete
 
 no_assign (const no_assign &)=default
 
 no_assign ()=default
 

Detailed Description

template<typename RandomAccessIterator, typename Compare>
class tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >

Body class used to test if elements in a range are presorted.

Definition at line 124 of file parallel_sort.h.

Constructor & Destructor Documentation

◆ quick_sort_pretest_body()

template<typename RandomAccessIterator , typename Compare >
tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::quick_sort_pretest_body ( const Compare &  _comp)
inline

Definition at line 128 of file parallel_sort.h.

Member Function Documentation

◆ operator()()

template<typename RandomAccessIterator , typename Compare >
void tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::operator() ( const blocked_range< RandomAccessIterator > &  range) const
inline

Definition at line 130 of file parallel_sort.h.

130  {
131  task &my_task = task::self();
132  RandomAccessIterator my_end = range.end();
133 
134  int i = 0;
135  for (RandomAccessIterator k = range.begin(); k != my_end; ++k, ++i) {
136  if ( i%64 == 0 && my_task.is_cancelled() ) break;
137 
138  // The k-1 is never out-of-range because the first chunk starts at begin+serial_cutoff+1
139  if ( comp( *(k), *(k-1) ) ) {
140  my_task.cancel_group_execution();
141  break;
142  }
143  }
144  }
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task
static task &__TBB_EXPORTED_FUNC self()
The innermost task being executed or destroyed by the current thread at the moment.
Definition: task.cpp:201

References tbb::blocked_range< Value >::begin(), tbb::task::cancel_group_execution(), tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::comp, tbb::blocked_range< Value >::end(), tbb::task::is_cancelled(), and tbb::task::self().

Here is the call graph for this function:

Member Data Documentation

◆ comp

template<typename RandomAccessIterator , typename Compare >
const Compare& tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::comp
private

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.