System::Threading::Tasks::Parallel::ForEach Methode
Inhalt
[
Ausblenden
]Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>>&, const Action<TSource>&) method
Führt eine foreach-Operation auf einem IEnumerable aus, bei der die Iterationen parallel ausgeführt werden können.
template<typename TSource> static ParallelLoopResult System::Threading::Tasks::Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>> &source, const Action<TSource> &body)
| Parameter | Beschreibung |
|---|---|
| TSource | Der Typ der Daten in der Quelle. |
| Parameter | Typ | Beschreibung |
|---|---|---|
| Quelle | const SharedPtr<Collections::Generic::IEnumerable<TSource>>& | Eine aufzählbare Datenquelle. |
| body | const Action<TSource>& | Der Delegat, der einmal pro Iteration aufgerufen wird. |
ReturnValue
Eine ParallelLoopResult Struktur, die Informationen darüber enthält, welcher Teil der Schleife abgeschlossen wurde.
Hinweise
Verwendet die Standard‑ParallelOptions mit unbegrenzter Parallelität und ohne Abbruch.
Siehe auch
- Class ParallelLoopResult
- Typedef SharedPtr
- Class IEnumerable
- Typedef Action
- Class Parallel
- Namespace System::Threading::Tasks
- Library Aspose.Font for C++
Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>>&, const SharedPtr<ParallelOptions>&, const Action<TSource>&) method
Führt eine foreach-Operation auf einem IEnumerable aus, bei der die Iterationen parallel ausgeführt werden können.
template<typename TSource> static ParallelLoopResult System::Threading::Tasks::Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>> &source, const SharedPtr<ParallelOptions> ¶llelOptions, const Action<TSource> &body)
| Parameter | Beschreibung |
|---|---|
| TSource | Der Typ der Daten in der Quelle. |
| Parameter | Typ | Beschreibung |
|---|---|---|
| Quelle | const SharedPtr<Collections::Generic::IEnumerable<TSource>>& | Eine aufzählbare Datenquelle. |
| parallelOptions | const SharedPtr<ParallelOptions>& | Ein Objekt, das das Verhalten dieser Operation konfiguriert. |
| body | const Action<TSource>& | Der Delegat, der einmal pro Iteration aufgerufen wird. |
ReturnValue
Eine ParallelLoopResult Struktur, die Informationen darüber enthält, welcher Teil der Schleife abgeschlossen wurde.
Hinweise
Diese Methode partitioniert die aufzählbare Quelle und führt den Body‑Delegaten gleichzeitig auf mehreren Threads aus.
Siehe auch
- Class ParallelLoopResult
- Typedef SharedPtr
- Class IEnumerable
- Class ParallelOptions
- Typedef Action
- Class Parallel
- Namespace System::Threading::Tasks
- Library Aspose.Font for C++