
Context for complex loops including init and finalize section.
| FORCONTEXT | Either DynamicContext<CONTEXT> or StaticContext<CONTEXT>. |
| INDEXTYPE | An integral type used for the index of the loop. |
| INIT | A class containing an operator ()(CONTEXT&) for per-thread initialization before the loop. |
| FINALIZE | A class containing an operator ()(CONTEXT&) for per-thread cleanup after the loop. |
Public Member Functions | |
| ForAlignedContext (INDEXTYPE from, INDEXTYPE to, Int threadIndex, ParallelFor::BreakCondition *breakCondition, const INIT &init, const FINALIZE &finalize) | |
| void | Init () |
| Bool | Finalize () |
Private Attributes | |
| const INIT & | _init |
| const FINALIZE & | _finalize |
| Bool | _isInitialized |
| ForAlignedContext | ( | INDEXTYPE | from, |
| INDEXTYPE | to, | ||
| Int | threadIndex, | ||
| ParallelFor::BreakCondition * | breakCondition, | ||
| const INIT & | init, | ||
| const FINALIZE & | finalize | ||
| ) |
| [in] | from | Start index. |
| [in] | to | End index (excluded) |
| [in] | threadIndex | Initial thread index. |
| [in] | breakCondition | Pointer to a BreakCondition or nullptr (break not supported by context). |
| [in] | init | Lambda being called in the thread context before the loop starts. |
| [in] | finalize | Lambda being called in the thread context after the loop has finished. |
| void Init | ( | ) |
Calls INIT method for user data initialization of the context.
| Bool Finalize | ( | ) |
Calls FINALIZE method to finalize user data of the context. Returns false if Init() hasn't or Finalize() has already been called.
|
private |
|
private |
|
private |