ForEach()
Contents
[
Hide
]Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>>&, const SharedPtr<ParallelOptions>&, const Action<TSource>&) method
Executes a foreach operation on an IEnumerable in which iterations may run in parallel.
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)
Template parameters
| Parameter | Description |
|---|---|
| TSource | The type of the data in the source. |
Arguments
| Parameter | Type | Description |
|---|---|---|
| source | const SharedPtr<Collections::Generic::IEnumerable<TSource>>& | An enumerable data source. |
| parallelOptions | const SharedPtr<ParallelOptions>& | An object that configures the behavior of this operation. |
| body | const Action<TSource>& | The delegate that is invoked once per iteration. |
Return Value
A ParallelLoopResult structure that contains information on what portion of the loop completed.
Remarks
This method partitions the source enumerable and executes the body delegate on multiple threads concurrently.
Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>>&, const Action<TSource>&) method
Executes a foreach operation on an IEnumerable in which iterations may run in parallel.
template<typename TSource> static ParallelLoopResult System::Threading::Tasks::Parallel::ForEach(const SharedPtr<Collections::Generic::IEnumerable<TSource>> &source, const Action<TSource> &body)
Template parameters
| Parameter | Description |
|---|---|
| TSource | The type of the data in the source. |
Arguments
| Parameter | Type | Description |
|---|---|---|
| source | const SharedPtr<Collections::Generic::IEnumerable<TSource>>& | An enumerable data source. |
| body | const Action<TSource>& | The delegate that is invoked once per iteration. |
Return Value
A ParallelLoopResult structure that contains information on what portion of the loop completed.
Remarks
Uses default ParallelOptions with unlimited parallelism and no cancellation.
See Also
- Typedef SharedPtr
- Typedef Action
- Class ParallelLoopResult
- Class IEnumerable
- Class ParallelOptions
- Class Parallel
- Namespace System::Threading::Tasks
- Library Aspose.Slides