QtConcurrent Namespace
QtConcurrent 名前空間は、低レベルのスレッドプリミティブを使用せずにマルチスレッドプログラムを記述できるようにする高レベルの API を提供します。詳細...
ヘッダー | #include <QtConcurrent> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Concurrent) target_link_libraries(mytarget PRIVATE Qt6::Concurrent) |
qmake: | QT += concurrent |
- QtConcurrent はThreading Classes に含まれています。
クラス
(since 6.0) class | QTaskBuilder |
型
enum class | FutureResult { Ignore } |
InvokeResultType | |
enum | ReduceOption { UnorderedReduce, OrderedReduce, SequentialReduce } |
flags | ReduceOptions |
関数
void | blockingFilter(Sequence &sequence, KeepFunctor &&filterFunction) |
void | blockingFilter(QThreadPool *pool, Sequence &sequence, KeepFunctor &&filterFunction) |
std::decay_t<Sequence> | blockingFiltered(Sequence &&sequence, KeepFunctor &&filterFunction) |
OutputSequence | blockingFiltered(Iterator begin, Iterator end, KeepFunctor &&filterFunction) |
std::decay_t<Sequence> | blockingFiltered(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction) |
OutputSequence | blockingFiltered(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction) |
ResultType | blockingFilteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingFilteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
void | blockingMap(Sequence &&sequence, MapFunctor &&function) |
void | blockingMap(Iterator begin, Iterator end, MapFunctor &&function) |
void | blockingMap(QThreadPool *pool, Sequence &&sequence, MapFunctor function) |
void | blockingMap(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function) |
OutputSequence | blockingMapped(InputSequence &&sequence, MapFunctor &&function) |
Sequence | blockingMapped(Iterator begin, Iterator end, MapFunctor &&function) |
OutputSequence | blockingMapped(QThreadPool *pool, InputSequence &&sequence, MapFunctor &&function) |
Sequence | blockingMapped(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function) |
ResultType | blockingMappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
ResultType | blockingMappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<void> | filter(Sequence &sequence, KeepFunctor &&filterFunction) |
QFuture<void> | filter(QThreadPool *pool, Sequence &sequence, KeepFunctor &&filterFunction) |
QFuture<typename std::decay_t<Sequence>::value_type> | filtered(Sequence &&sequence, KeepFunctor &&filterFunction) |
QFuture<typename qValueType<Iterator>::value_type> | filtered(Iterator begin, Iterator end, KeepFunctor &&filterFunction) |
QFuture<typename std::decay_t<Sequence>::value_type> | filtered(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction) |
QFuture<typename qValueType<Iterator>::value_type> | filtered(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction) |
QFuture<ResultType> | filteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | filteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<void> | map(Sequence &&sequence, MapFunctor &&function) |
QFuture<void> | map(Iterator begin, Iterator end, MapFunctor &&function) |
QFuture<void> | map(QThreadPool *pool, Sequence &&sequence, MapFunctor &&function) |
QFuture<void> | map(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function) |
QFuture<QtPrivate::MapResultType<Sequence, MapFunctor>> | mapped(Sequence &&sequence, MapFunctor &&function) |
QFuture<QtPrivate::MapResultType<Iterator, MapFunctor>> | mapped(Iterator begin, Iterator end, MapFunctor &&function) |
QFuture<QtPrivate::MapResultType<Sequence, MapFunctor>> | mapped(QThreadPool *pool, Sequence &&sequence, MapFunctor &&function) |
QFuture<QtPrivate::MapResultType<Iterator, MapFunctor>> | mapped(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function) |
QFuture<ResultType> | mappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<ResultType> | mappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce)) |
QFuture<T> | run(Function function, ...) |
QFuture<T> | run(QThreadPool *pool, Function function, ...) |
(since 6.0) QtConcurrent::QTaskBuilder<Task> | task(Task &&task) |
詳細説明
利用可能な関数の概要については Qt Concurrentモジュールのドキュメントを参照してください。
型のドキュメント
enum class QtConcurrent::FutureResult
この列挙型は、未来オブジェクトを返さないQtConcurrent::QTaskBuilder::spawn(QtConcurrent::FutureResult) の特別なオーバーロードを呼び出すために使用されます。
定数 | 値 | 説明 |
---|---|---|
QtConcurrent::FutureResult::Ignore | 0 | コードの可読性を向上させるために導入された補助タグです。 |
[alias]
InvokeResultType
この型の簡略化された定義は次のようになる:
template <class Task, class ...Args> using InvokeResultType = std::invoke_result_t<std::decay_t<Task>, std::decay_t<Args>...>;
実際の実装では、指定された引数でタスクを起動できるかどうかのコンパイル時のチェックも含まれます。
enum QtConcurrent::ReduceOption
flags QtConcurrent::ReduceOptions
この列挙型は、map または filter 関数の結果を reduce 関数に渡す順序を指定します。
定数 | 値 | 説明 |
---|---|---|
QtConcurrent::UnorderedReduce | 0x1 | 任意の順序でリダクションが行われます。 |
QtConcurrent::OrderedReduce | 0x2 | リダクションは元の順序で行われます。 |
QtConcurrent::SequentialReduce | 0x4 | 一度に1つのスレッドのみが reduce 関数に入る。(並列リダクションはQt Concurrent の将来のバージョンでサポートされるかもしれない)。 |
ReduceOptions 型はQFlags<ReduceOption> の typedef である.これはReduceOption値のORの組み合わせを格納する。
関数のドキュメント
template <typename Sequence, typename KeepFunctor> void QtConcurrent::blockingFilter(Sequence &sequence, KeepFunctor &&filterFunction)
sequence の各項目に対して、filterFunction を1回呼び出します。filterFunction がtrue
を返した場合、その項目はsequence に保持されます。そうでない場合、その項目はsequence から削除されます。
このメソッドは、イテレータを操作するオーバーロードを持たないことに注意してください。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされます。
Concurrent Filter および Filter-Reduceも参照してください 。
template <typename Sequence, typename KeepFunctor> void QtConcurrent::blockingFilter(QThreadPool *pool, Sequence &sequence, KeepFunctor &&filterFunction)
sequence の各項目について、filterFunction を1回呼び出す。filterFunction へのすべてのコールは、QThreadPool pool から取得したスレッドから呼び出される。filterFunction がtrue
を返した場合、アイテムはsequence に保持される。そうでない場合、アイテムはsequence から削除される。
このメソッドは、イテレータを操作するオーバーロードを持たないことに注意してください。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされます。
Concurrent Filter および Filter-Reduceも参照してください 。
template <typename Sequence, typename KeepFunctor> std::decay_t<Sequence> QtConcurrent::blockingFiltered(Sequence &&sequence, KeepFunctor &&filterFunction)
sequence の各項目についてfilterFunction を1回呼び、保持されている項目の新しい Sequence を返す。filterFunction がtrue
を返す場合、その項目のコピーが新しい Sequence に入れられる。そうでない場合、その項目は新しいSequenceには現れません。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
filtered() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename OutputSequence, typename Iterator, typename KeepFunctor> OutputSequence QtConcurrent::blockingFiltered(Iterator begin, Iterator end, KeepFunctor &&filterFunction)
begin からend までの各項目について、filterFunction を1回呼び、保持されている項目の新しい Sequence を返す。filterFunction がtrue
を返す場合、その項目のコピーが新しい Sequence に入れられる。そうでない場合、その項目は新しいSequenceには現れません。
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされます。
filtered() およびConcurrent Filter と Filter-Reduceも参照してください 。
template <typename Sequence, typename KeepFunctor> std::decay_t<Sequence> QtConcurrent::blockingFiltered(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction)
sequence の各項目についてfilterFunction を1回呼び 出し、保持されている項目の新しいシーケンスを返す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。filterFunction がtrue
を返す場合、項目のコピーが新しいSequenceに入れられる。そうでない場合、アイテムは新しいシーケンスには表示されません。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされます。
filtered() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename OutputSequence, typename Iterator, typename KeepFunctor> OutputSequence QtConcurrent::blockingFiltered(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction)
begin からend までの各項目について、filterFunction を1回呼び出し、保持されている項目の新しいシーケンスを返す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。filterFunction がtrue
を返す場合、アイテムのコピーが新しいSequenceに入れられる。そうでない場合、その項目は新しいシーケンスには表示されません。
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされます。
filtered() およびConcurrent Filter と Filter-Reduceも参照してください 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が返り値となる。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が の場合、 が呼び出される順序は不定である。 が の場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が返り値となる。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が の場合、 が呼び出される順序は不定である。 が の場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返す各項目に対するreduceFunction の結果である。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が戻り値となる。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しはこの値で操作される。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が戻り値となる。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しはこの値で操作される。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返す各項目に対するreduceFunction の結果である。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返した場合、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返した各項目に対するreduceFunction の結果である。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値を操作する。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返した場合、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返した各項目に対するreduceFunction の結果である。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値を操作する。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
filteredReduced() およびConcurrent Filter と Filter-Reduceも参照のこと 。
template <typename Sequence, typename MapFunctor> void QtConcurrent::blockingMap(Sequence &&sequence, MapFunctor &&function)
sequence の各項目について、function を1回呼び出す。function は項目への参照を取るので、項目に加えられた修正はsequence に表示される。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
map() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename Iterator, typename MapFunctor> void QtConcurrent::blockingMap(Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各アイテムに対して、function を1回呼び出します。function はアイテムへの参照を取るので、アイテムに加えられた修正は、イテレータが属するシーケンスに現れます。
注意: この関数は、イテレータが処理中のシーケンスの最後に達するまでブロックされます。
map() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename Sequence, typename MapFunctor> void QtConcurrent::blockingMap(QThreadPool *pool, Sequence &&sequence, MapFunctor function)
sequence の各項目について、function を1回呼び出す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。function はアイテムへの参照を取るので、アイテムに加えられた修正はsequence に表示される。
注意: この関数は、シーケンス内のすべてのアイテムが処理されるまでブロックされる。
map() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename Iterator, typename MapFunctor> void QtConcurrent::blockingMap(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各項目について、function を1回呼び出す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。function はアイテムへの参照を取り、アイテムに加えられた変更がイテレータの属するシーケンスに現れるようにする。
注意: この関数は、イテレータが処理中のシーケンスの最後に達するまでブロックされます。
map() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename OutputSequence, typename InputSequence, typename MapFunctor> OutputSequence QtConcurrent::blockingMapped(InputSequence &&sequence, MapFunctor &&function)
sequence の各項目に対してfunction を 1 回呼び出し、結果を含む OutputSequence を返す。結果の型は、MapFunctor が返す型と一致する。
注: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename Sequence, typename Iterator, typename MapFunctor> Sequence QtConcurrent::blockingMapped(Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各項目について、function を1回呼び、その結果をコンテナとして返す。コンテナのタイプは、このようにテンプレートの引数として指定することができる:
注: この関数は、イテレータが処理中のシーケンスの最後に達するまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename OutputSequence, typename InputSequence, typename MapFunctor> OutputSequence QtConcurrent::blockingMapped(QThreadPool *pool, InputSequence &&sequence, MapFunctor &&function)
sequence の各項目に対してfunction を1回呼び、結果を含む OutputSequence を返す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。結果の型は、MapFunctor によって返される型と一致する。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename Sequence, typename Iterator, typename MapFunctor> Sequence QtConcurrent::blockingMapped(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各項目について、function を1回呼び 出し、その結果をコンテナとして返す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。コンテナのタイプは、以下のようにテンプレート引数として指定できる:
注: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction は同時に呼び出されるが、一度に呼び出されるスレッドはreduceFunction だけであることに注意。reduceFunction が呼び出される順序は、reduceOptions によって決定される。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順序は未定義である。reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
blockingMappedReduced() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction は同時に呼び出されるが、reduceFunction を呼び出すのは一度に1つのスレッドだけであることに注意。reduceFunction が呼び出される順序は、reduceOptions によって決定される。
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。各mapFunction の返り値はreduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順番は、 によって決定される。reduceFunction reduceOptions
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。各mapFunction の戻り値は、reduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しは、この値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順序は未定義である。reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
blockingMappedReduced() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction は同時に呼び出されるが、reduceFunction を呼び出すのは一度に1つのスレッドだけであることに注意。reduceFunction が呼び出される順序は不定である。
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックする。
blockingMappedReduced() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順番は、 によって決定される。reduceFunction reduceOptions
注意: この関数は、シーケンス内のすべての項目が処理されるまでブロックされる。
mapped() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順序は未定義である。reduceFunction
注意: この関数は、イテレータが処理中のシーケンスの終端に達するまでブロックされる。
blockingMappedReduced() およびConcurrent Map と Map-Reduceも参照のこと 。
template <typename Sequence, typename KeepFunctor> QFuture<void> QtConcurrent::filter(Sequence &sequence, KeepFunctor &&filterFunction)
sequence の各項目に対して、filterFunction を1回呼び出します。filterFunction がtrue
を返した場合、その項目はsequence に保持されます。そうでない場合、その項目はsequence から削除されます。
このメソッドにはイテレータを扱うオーバーロードがないことに注意してください。
Concurrent Filter および Filter-Reduceも参照してください 。
template <typename Sequence, typename KeepFunctor> QFuture<void> QtConcurrent::filter(QThreadPool *pool, Sequence &sequence, KeepFunctor &&filterFunction)
sequence の各項目について、filterFunction を1回呼び出す。filterFunction へのすべてのコールは、QThreadPool pool から取得したスレッドから呼び出される。filterFunction がtrue
を返した場合、アイテムはsequence に保持される。そうでない場合、アイテムはsequence から削除される。
このメソッドは、イテレータを操作するオーバーロードを持たないことに注意してください。
Concurrent Filter および Filter-Reduceも参照してください 。
template <typename Sequence, typename KeepFunctor> QFuture<typename std::decay_t<Sequence>::value_type> QtConcurrent::filtered(Sequence &&sequence, KeepFunctor &&filterFunction)
sequence の各項目についてfilterFunction を1回呼び、保持されている項目の新しい Sequence を返す。filterFunction がtrue
を返す場合、その項目のコピーが新しい Sequence に入れられる。そうでない場合、その項目は新しいSequenceには現れません。
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename Iterator, typename KeepFunctor> QFuture<typename qValueType<Iterator>::value_type> QtConcurrent::filtered(Iterator begin, Iterator end, KeepFunctor &&filterFunction)
begin からend までの各項目について、filterFunction を1回呼び、保持されている項目の新しい Sequence を返す。filterFunction がtrue
を返す場合、その項目のコピーが新しい Sequence に入れられる。そうでない場合、その項目は新しいシーケンスには現れません。
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename Sequence, typename KeepFunctor> QFuture<typename std::decay_t<Sequence>::value_type> QtConcurrent::filtered(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction)
sequence の各項目についてfilterFunction を1回呼び 出し、保持されている項目の新しいシーケンスを返す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。filterFunction がtrue
を返す場合、項目のコピーが新しいSequenceに入れられる。そうでない場合、その項目は新しいシーケンスには表示されない。
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename Iterator, typename KeepFunctor> QFuture<typename qValueType<Iterator>::value_type> QtConcurrent::filtered(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction)
begin からend までの各項目について、filterFunction を1回呼び出し、保持されている項目の新しいシーケンスを返す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。filterFunction がtrue
を返す場合、アイテムのコピーが新しいSequenceに入れられる。そうでない場合、その項目は新しいシーケンスには表示されない。
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::filteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が返り値となる。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が の場合、 が呼び出される順序は不定である。 が の場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::filteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が返り値となる。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が の場合、 が呼び出される順序は不定である。 が の場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::filteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返す各項目に対するreduceFunction の結果である。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::filteredReduced(Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返す各項目について、reduceFunction の結果である。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しはこの値で操作される。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::filteredReduced(Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。ある項目についてfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、filterFunction がtrue
を返す各項目について、reduceFunction の結果が戻り値となる。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しはこの値で操作される。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::filteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返すと、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返す各項目に対するreduceFunction の結果である。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が の場合、 が呼び出される順序は不定である。 が の場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::filteredReduced(QThreadPool *pool, Sequence &&sequence, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返した場合、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返した各項目に対するreduceFunction の結果である。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値を操作する。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::filteredReduced(QThreadPool *pool, Iterator begin, Iterator end, KeepFunctor &&filterFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、filterFunction を1回呼び出す。filterFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。ある項目に対してfilterFunction がtrue
を返した場合、その項目はreduceFunction に渡される。言い換えると、返り値は、filterFunction がtrue
を返した各項目に対するreduceFunction の結果である。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値を操作する。
filterFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が である場合、 が呼び出される順序は不定である。 が である場合、 は元の順序で呼び出される。reduceOptions QtConcurrent::UnorderedReduce reduceFunction reduceOptions QtConcurrent::OrderedReduce reduceFunction
Concurrent FilterおよびFilter-Reduceも参照のこと 。
template <typename Sequence, typename MapFunctor> QFuture<void> QtConcurrent::map(Sequence &&sequence, MapFunctor &&function)
sequence の各項目について、function を1回呼び出す。function はアイテムへの参照を取るので、アイテムに加えられた修正はsequence に表示される。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Iterator, typename MapFunctor> QFuture<void> QtConcurrent::map(Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各アイテムに対して、function を1回呼び出す。function はアイテムへの参照を取るので、アイテムに加えられた修正は、イテレータが属するシーケンスに表示される。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Sequence, typename MapFunctor> QFuture<void> QtConcurrent::map(QThreadPool *pool, Sequence &&sequence, MapFunctor &&function)
sequence の各項目について、function を1回呼び出す。function への呼び出しはすべて、QThreadPool pool から取得したスレッドから呼び出される。function はアイテムへの参照を取るので、アイテムに加えられた修正はsequence に表示される。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Iterator, typename MapFunctor> QFuture<void> QtConcurrent::map(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各項目について、function を1回呼び出す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。function はアイテムへの参照を取るので、アイテムに加えられた修正は、イテレータが属するシーケンスに表示される。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Sequence, typename MapFunctor> QFuture<QtPrivate::MapResultType<Sequence, MapFunctor>> QtConcurrent::mapped(Sequence &&sequence, MapFunctor &&function)
sequence の各項目に対してfunction を一度だけ呼び出し、結果としてマッピングされた各項目を持つ未来を返す。QFuture::const_iterator またはQFutureIterator を使って、結果を繰り返し処理することができる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Iterator, typename MapFunctor> QFuture<QtPrivate::MapResultType<Iterator, MapFunctor>> QtConcurrent::mapped(Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各項目について、function を一度だけ呼び出し、結果としてマッピングされた各項目を持つ未来を返す。QFuture::const_iterator またはQFutureIterator を使って、結果を繰り返し処理することができる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Sequence, typename MapFunctor> QFuture<QtPrivate::MapResultType<Sequence, MapFunctor>> QtConcurrent::mapped(QThreadPool *pool, Sequence &&sequence, MapFunctor &&function)
sequence の各項目について、function を一度だけ呼び出し、結果としてマッピングされた各項目を持つフューチャーを返す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。QFuture::const_iterator またはQFutureIterator を使用して、結果を繰り返し処理することができる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename Iterator, typename MapFunctor> QFuture<QtPrivate::MapResultType<Iterator, MapFunctor>> QtConcurrent::mapped(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&function)
begin からend までの各項目について、function を一度だけ呼び出し、結果としてマッピングされた各項目を持つフューチャーを返す。function へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。QFuture::const_iterator またはQFutureIterator を使用して、結果を繰り返し処理することができる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::mappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction は同時に呼び出されるが、一度に呼び出されるスレッドはreduceFunction だけであることに注意。reduceFunction が呼び出される順番は、reduceOptions によって決定される。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::mappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。デフォルトでは、 が呼び出される順序は不定である。reduceFunction
注: QtConcurrent::OrderedReduce の結果は、順序付き削減となる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::mappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction は同時に呼び出されるが、reduceFunction を呼び出すのは一度に1つのスレッドだけであることに注意。reduceFunction が呼び出される順番は、reduceOptions によって決定される。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::mappedReduced(Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。各mapFunction の返り値はreduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順番は、 によって決定される。reduceFunction reduceOptions
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::mappedReduced(Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。各mapFunction の戻り値は、reduceFunction に渡される。関数が呼び出されたとき、結果値はinitialValue に初期化され、reduceFunction への最初の呼び出しは、この値で操作される。
mapFunction は同時に呼び出されるが、reduceFunction を呼び出すのは一度に1つのスレッドだけであることに注意。デフォルトでは、reduceFunction が呼び出される順序は不定である。
注: QtConcurrent::OrderedReduce の結果は、順序付き削減となる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> QFuture<ResultType> QtConcurrent::mappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。
mapFunction は同時に呼び出されるが、reduceFunction を呼び出すのは一度に1つのスレッドだけであることに注意。デフォルトでは、reduceFunction が呼び出される順序は不定である。
注: QtConcurrent::OrderedReduce の結果は、順序付き削減である。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::mappedReduced(QThreadPool *pool, Sequence &&sequence, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
sequence の各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。 が呼び出される順番は、 によって決定される。reduceFunction reduceOptions
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> QFuture<ResultType> QtConcurrent::mappedReduced(QThreadPool *pool, Iterator begin, Iterator end, MapFunctor &&mapFunction, ReduceFunctor &&reduceFunction, InitialValueType &&initialValue, QtConcurrent::ReduceOptions reduceOptions = ReduceOptions(UnorderedReduce | SequentialReduce))
begin からend までの各項目について、mapFunction を1回呼び出す。mapFunction へのすべての呼び出しは、QThreadPool pool から取得したスレッドから呼び出される。各mapFunction の戻り値はreduceFunction に渡される。結果値は、関数が呼び出されたときにinitialValue に初期化され、reduceFunction への最初の呼び出しがこの値で操作される。
mapFunction reduceFunction は同時に呼び出されるが、一度に呼び出されるのは1つのスレッドのみである。デフォルトでは、 が呼び出される順序は不定である。reduceFunction
注: QtConcurrent::OrderedReduce の結果は、順序付き削減となる。
Concurrent MapおよびMap-Reduceも参照のこと 。
template <typename T> QFuture<T> QtConcurrent::run(Function function, ...)
に相当する。
QtConcurrent::run(QThreadPool::globalInstance(), function, ...);
function を別スレッドで実行する。スレッドはグローバルなQThreadPool から取得される。function function が実行されるのは、スレッドが利用可能になってからである。
基本モードでは、T はfunction の戻り値と同じ型である。非ボイド戻り値は、QFuture::result() 関数でアクセスできる。
基本モードでは、返されたQFuture は、実行中/終了中のステータスと関数の戻り値を問い合わせるためにのみ使用できる。特に、キャンセルや一時停止は、未来の背後にある計算が開始されていない場合にのみ発行できます。
プロミス・モードでの実行では、function は void を返すことが期待され、関数の引数リストの最初の引数として配置されたQPromise<T> &
型の追加引数を取らなければなりません。Tは結果の型であり、返されるQFuture<T>
と同じである。
基本モードと同様のプロミス付き実行モードでは、返されるQFuture は、実行中/終了中のステータスや関数が報告した値を問い合わせるために使用することができます。さらに、実行中のタスクの一時停止やキャンセル、呼び出されたfunction からの複数の結果の取得、function によって報告された進捗状況の監視にも使用できる。
Concurrent Run(基本モード)、Concurrent Run With Promise、QThreadPool::start ()も参照のこと 。
template <typename T> QFuture<T> QtConcurrent::run(QThreadPool *pool, Function function, ...)
pool でfunction をスケジュールする。function 。function は、スレッドが使用可能になった時点で初めて実行される。
基本モードでは、T はfunction の戻り値と同じ型である。void でない戻り値には、QFuture::result() 関数でアクセスできる。
基本モードでは、返されたQFuture は、実行中/終了中のステータスと関数の戻り値を問い合わせるためにのみ使用できる。特に、キャンセルや一時停止は、未来の背後にある計算が開始されていない場合にのみ発行できます。
プロミス・モードでの実行では、function は void を返すことが期待され、関数の引数リストの最初の引数として配置されたQPromise<T> &
型の追加引数を取らなければなりません。Tは結果の型であり、返されるQFuture<T>
と同じである。
基本モードと同様のプロミス付き実行モードでは、返されるQFuture は、実行中/終了中のステータスや関数が報告した値を問い合わせるために使用することができます。さらに、実行中のタスクの一時停止やキャンセル、呼び出されたfunction からの複数の結果の取得、function によって報告された進捗状況の監視にも使用できる。
Concurrent Run(基本モード)、Concurrent Run With Promise、QThreadPool::start ()も参照のこと 。
[since 6.0]
template <typename Task> QtConcurrent::QTaskBuilder<Task> QtConcurrent::task(Task &&task)
QtConcurrent::QTaskBuilder のインスタンスを作成します。このオブジェクトは、いくつかのパラメータを調整したり、別スレッドでtask を実行したりするために使用できます。
この関数は Qt 6.0 で導入されました。
Concurrent TaskおよびQtConcurrent::QTaskBuilderも参照してください 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.