#include
<QtCore/qglobal.h>Go to the source code of this file.
Classes |
|
| class | qLess< T > |
| class | qGreater< T > |
Namespaces |
|
| namespace | QAlgorithmsPrivate |
Functions |
|
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
| Q_OUTOFLINE_TEMPLATE void | qSortHelper (RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) |
| template<typename RandomAccessIterator , typename T > | |
| void | qSortHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &dummy) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
| Q_OUTOFLINE_TEMPLATE void | qStableSortHelper (RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) |
| template<typename RandomAccessIterator , typename T > | |
| void | qStableSortHelper (RandomAccessIterator, RandomAccessIterator, const T &) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qLowerBoundHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qUpperBoundHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qBinaryFindHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) |
| template<typename InputIterator , typename OutputIterator > | |
| OutputIterator | qCopy (InputIterator begin, InputIterator end, OutputIterator dest) |
| template<typename BiIterator1 , typename BiIterator2 > | |
| BiIterator2 | qCopyBackward (BiIterator1 begin, BiIterator1 end, BiIterator2 dest) |
| template<typename InputIterator1 , typename InputIterator2 > | |
| bool | qEqual (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) |
| template<typename ForwardIterator , typename T > | |
| void | qFill (ForwardIterator first, ForwardIterator last, const T &val) |
| template<typename Container , typename T > | |
| void | qFill (Container &container, const T &val) |
| template<typename InputIterator , typename T > | |
| InputIterator | qFind (InputIterator first, InputIterator last, const T &val) |
| template<typename Container , typename T > | |
| Container::const_iterator | qFind (const Container &container, const T &val) |
| template<typename InputIterator , typename T , typename Size > | |
| void | qCount (InputIterator first, InputIterator last, const T &value, Size &n) |
| template<typename Container , typename T , typename Size > | |
| void | qCount (const Container &container, const T &value, Size &n) |
| template<typename RandomAccessIterator > | |
| void | qSort (RandomAccessIterator start, RandomAccessIterator end) |
| template<typename RandomAccessIterator , typename LessThan > | |
| void | qSort (RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) |
| template<typename Container > | |
| void | qSort (Container &c) |
| template<typename RandomAccessIterator > | |
| void | qStableSort (RandomAccessIterator start, RandomAccessIterator end) |
| template<typename RandomAccessIterator , typename LessThan > | |
| void | qStableSort (RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan) |
| template<typename Container > | |
| void | qStableSort (Container &c) |
| template<typename RandomAccessIterator , typename T > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qLowerBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qLowerBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) |
| template<typename Container , typename T > | |
|
Q_OUTOFLINE_TEMPLATE Container::const_iterator |
qLowerBound (const Container &container, const T &value) |
| template<typename RandomAccessIterator , typename T > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qUpperBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qUpperBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) |
| template<typename Container , typename T > | |
|
Q_OUTOFLINE_TEMPLATE Container::const_iterator |
qUpperBound (const Container &container, const T &value) |
| template<typename RandomAccessIterator , typename T > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qBinaryFind (RandomAccessIterator begin, RandomAccessIterator end, const T &value) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
|
Q_OUTOFLINE_TEMPLATE RandomAccessIterator |
qBinaryFind (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) |
| template<typename Container , typename T > | |
|
Q_OUTOFLINE_TEMPLATE Container::const_iterator |
qBinaryFind (const Container &container, const T &value) |
| template<typename ForwardIterator > | |
| Q_OUTOFLINE_TEMPLATE void | qDeleteAll (ForwardIterator begin, ForwardIterator end) |
| template<typename Container > | |
| void | qDeleteAll (const Container &c) |
| template<typename RandomAccessIterator > | |
| Q_OUTOFLINE_TEMPLATE void | qReverse (RandomAccessIterator begin, RandomAccessIterator end) |
| template<typename RandomAccessIterator > | |
| Q_OUTOFLINE_TEMPLATE void | qRotate (RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end) |
| template<typename RandomAccessIterator , typename T , typename LessThan > | |
| Q_OUTOFLINE_TEMPLATE void | qMerge (RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan) |
| OutputIterator qCopy | ( | InputIterator | begin, |
| InputIterator | end, | ||
| OutputIterator | dest | ||
| ) | [inline] |
Definition at line 79 of file qalgorithms.h.
{
while (begin != end)
*dest++ = *begin++;
return dest;
}
| BiIterator2 qCopyBackward | ( | BiIterator1 | begin, |
| BiIterator1 | end, | ||
| BiIterator2 | dest | ||
| ) | [inline] |
Definition at line 87 of file qalgorithms.h.
{
while (begin != end)
*--dest = *--end;
return dest;
}
| bool qEqual | ( | InputIterator1 | first1, |
| InputIterator1 | last1, | ||
| InputIterator2 | first2 | ||
| ) | [inline] |
Definition at line 95 of file qalgorithms.h.
{
for (; first1 != last1; ++first1, ++first2)
if (!(*first1 == *first2))
return false;
return true;
}
| void qFill | ( | ForwardIterator | first, |
| ForwardIterator | last, | ||
| const T & | val | ||
| ) | [inline] |
Definition at line 104 of file qalgorithms.h.
{
for (; first != last; ++first)
*first = val;
}
| void qFill | ( | Container & | container, |
| const T & | val | ||
| ) | [inline] |
Definition at line 111 of file qalgorithms.h.
{
qFill(container.begin(), container.end(), val);
}
| InputIterator qFind | ( | InputIterator | first, |
| InputIterator | last, | ||
| const T & | val | ||
| ) | [inline] |
Definition at line 117 of file qalgorithms.h.
{
while (first != last && !(*first == val))
++first;
return first;
}
| Container::const_iterator qFind | ( | const Container & | container, |
| const T & | val | ||
| ) | [inline] |
Definition at line 125 of file qalgorithms.h.
{
return qFind(container.constBegin(), container.constEnd(), val);
}
| void qCount | ( | InputIterator | first, |
| InputIterator | last, | ||
| const T & | value, | ||
| Size & | n | ||
| ) | [inline] |
Definition at line 131 of file qalgorithms.h.
{
for (; first != last; ++first)
if (*first == value)
++n;
}
| void qCount | ( | const Container & | container, |
| const T & | value, | ||
| Size & | n | ||
| ) | [inline] |
Definition at line 139 of file qalgorithms.h.
{
qCount(container.constBegin(), container.constEnd(), value, n);
}
| void qSort | ( | RandomAccessIterator | start, |
| RandomAccessIterator | end | ||
| ) | [inline] |
Definition at line 177 of file qalgorithms.h.
{
if (start != end)
QAlgorithmsPrivate::qSortHelper(start, end, *start);
}
| void qSort | ( | RandomAccessIterator | start, |
| RandomAccessIterator | end, | ||
| LessThan | lessThan | ||
| ) | [inline] |
Definition at line 184 of file qalgorithms.h.
{
if (start != end)
QAlgorithmsPrivate::qSortHelper(start, end, *start, lessThan);
}
| void qSort | ( | Container & | c | ) | [inline] |
Definition at line 191 of file qalgorithms.h.
{
#ifdef Q_CC_BOR
// Work around Borland 5.5 optimizer bug
c.detach();
#endif
if (!c.empty())
QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin());
}
| void qStableSort | ( | RandomAccessIterator | start, |
| RandomAccessIterator | end | ||
| ) | [inline] |
Definition at line 202 of file qalgorithms.h.
{
if (start != end)
QAlgorithmsPrivate::qStableSortHelper(start, end, *start);
}
| void qStableSort | ( | RandomAccessIterator | start, |
| RandomAccessIterator | end, | ||
| LessThan | lessThan | ||
| ) | [inline] |
Definition at line 209 of file qalgorithms.h.
{
if (start != end)
QAlgorithmsPrivate::qStableSortHelper(start, end, *start, lessThan);
}
| void qStableSort | ( | Container & | c | ) | [inline] |
Definition at line 216 of file qalgorithms.h.
{
#ifdef Q_CC_BOR
// Work around Borland 5.5 optimizer bug
c.detach();
#endif
if (!c.empty())
QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin());
}
| Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound | ( | RandomAccessIterator | begin, |
| RandomAccessIterator | end, | ||
| const T & | value | ||
| ) |
Definition at line 227 of file qalgorithms.h.
{
// Implementation is duplicated from QAlgorithmsPrivate to keep existing code
// compiling. We have to allow using *begin and value with different types,
// and then implementing operator< for those types.
RandomAccessIterator middle;
int n = end - begin;
int half;
while (n > 0) {
half = n >> 1;
middle = begin + half;
if (*middle < value) {
begin = middle + 1;
n -= half + 1;
} else {
n = half;
}
}
return begin;
}
| Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound | ( | RandomAccessIterator | begin, |
| RandomAccessIterator | end, | ||
| const T & | value, | ||
| LessThan | lessThan | ||
| ) |
Definition at line 250 of file qalgorithms.h.
{
return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan);
}
| Q_OUTOFLINE_TEMPLATE Container::const_iterator qLowerBound | ( | const Container & | container, |
| const T & | value | ||
| ) |
Definition at line 256 of file qalgorithms.h.
{
return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
}
| Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound | ( | RandomAccessIterator | begin, |
| RandomAccessIterator | end, | ||
| const T & | value | ||
| ) |
Definition at line 262 of file qalgorithms.h.
{
// Implementation is duplicated from QAlgorithmsPrivate.
RandomAccessIterator middle;
int n = end - begin;
int half;
while (n > 0) {
half = n >> 1;
middle = begin + half;
if (value < *middle) {
n = half;
} else {
begin = middle + 1;
n -= half + 1;
}
}
return begin;
}
| Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound | ( | RandomAccessIterator | begin, |
| RandomAccessIterator | end, | ||
| const T & | value, | ||
| LessThan | lessThan | ||
| ) |
Definition at line 283 of file qalgorithms.h.
{
return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan);
}
| Q_OUTOFLINE_TEMPLATE Container::const_iterator qUpperBound | ( | const Container & | container, |
| const T & | value | ||
| ) |
Definition at line 289 of file qalgorithms.h.
{
return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
}
| Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind | ( | RandomAccessIterator | begin, |
| RandomAccessIterator | end, | ||
| const T & | value | ||
| ) |
Definition at line 295 of file qalgorithms.h.
{
// Implementation is duplicated from QAlgorithmsPrivate.
RandomAccessIterator it = qLowerBound(begin, end, value);
if (it == end || value < *it)
return end;
return it;
}
| Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind | ( | RandomAccessIterator | begin, |
| RandomAccessIterator | end, | ||
| const T & | value, | ||
| LessThan | lessThan | ||
| ) |
Definition at line 307 of file qalgorithms.h.
{
return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan);
}
| Q_OUTOFLINE_TEMPLATE Container::const_iterator qBinaryFind | ( | const Container & | container, |
| const T & | value | ||
| ) |
Definition at line 313 of file qalgorithms.h.
{
return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
}
| Q_OUTOFLINE_TEMPLATE void qDeleteAll | ( | ForwardIterator | begin, |
| ForwardIterator | end | ||
| ) |
Definition at line 319 of file qalgorithms.h.
{
while (begin != end) {
delete *begin;
++begin;
}
}
| void qDeleteAll | ( | const Container & | c | ) | [inline] |
Definition at line 328 of file qalgorithms.h.
{
qDeleteAll(c.begin(), c.end());
}