tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare > Class Template Reference
Algorithms

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.

: comp(_comp) {}
tbb::interface9::internal::quick_sort_pretest_body::comp
const Compare & comp
Definition: parallel_sort.h:125

## 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.

{
task &my_task = task::self();
RandomAccessIterator my_end = range.end();
int i = 0;
for (RandomAccessIterator k = range.begin(); k != my_end; ++k, ++i) {
if ( i%64 == 0 && my_task.is_cancelled() ) break;
// The k-1 is never out-of-range because the first chunk starts at begin+serial_cutoff+1
if ( comp( *(k), *(k-1) ) ) {
my_task.cancel_group_execution();
break;
}
}
}
task
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
Definition: ittnotify_static.h:119
tbb::task::self
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

Definition at line 125 of file parallel_sort.h.

Referenced by tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::operator()().

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

- parallel_sort.h

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.