Kaim::IParallelForInterface Class Reference

#include <iparallelforinterface.h>

Class Description

Provides an abstract base interface for an object that can treat computational jobs in parallel.

This class cannot be used as-is; you must use an instance of a class that derives from IParallelForInterface and that implements its virtual methods. Autodesk Navigation provides a default implementation, KyGlue::TbbParallelForInterface, which uses the Threaded Building Blocks (TBB) libraries from Intel to manage the parallel execution of its computational jobs. You can also create your own implementation of IParallelForInterface if you need to support a different parallel computing system. For an example implementation, see the code for the KyGlue::TbbParallelForInterface class, available in the integration directory.

Inherits Kaim::RefCountBaseV< C, Stat >.

Inherited by KyGlue::TbbParallelForInterface.

Public Member Functions

virtual KyResult Init ()=0
 This method is expected to perform whatever steps are needed to initialize the parallelization mechanism. More...
 
virtual KyResult Terminate ()=0
 This method is expected to perform whatever steps are needed to shut down the parallelization mechanism. More...
 
virtual KyResult ParallelFor (void **elements, KyUInt32 elementsCount, Kaim::IParallelElementFunctor *functor)=0
 This is the main method of the IParallelForInterface: it is called by Autodesk Navigation to manage the parallel execution of an array of computational jobs. More...
 

Member Function Documentation

virtual KyResult Kaim::IParallelForInterface::Init ( )
pure virtual

This method is expected to perform whatever steps are needed to initialize the parallelization mechanism.

Called once by the Generator at the beginning of the data generation process.

Implemented in KyGlue::TbbParallelForInterface.

virtual KyResult Kaim::IParallelForInterface::ParallelFor ( void **  elements,
KyUInt32  elementsCount,
Kaim::IParallelElementFunctor functor 
)
pure virtual

This is the main method of the IParallelForInterface: it is called by Autodesk Navigation to manage the parallel execution of an array of computational jobs.

An implementation of this method should call the IParallelElementFunctor::Do() method for each element in the elements array.

Parameters
elementsAn array of void pointers, each of which points to a computational job that needs to be carried out.
elementsCountThe number of elements in the elements array.
functorA pointer to the object that should be responsible for actually treating each element in the elements array.

Implemented in KyGlue::TbbParallelForInterface.

virtual KyResult Kaim::IParallelForInterface::Terminate ( )
pure virtual

This method is expected to perform whatever steps are needed to shut down the parallelization mechanism.

Called once by the Generator at the end of the data generation process.

Implemented in KyGlue::TbbParallelForInterface.


The documentation for this class was generated from the following file: