PFUNC  1.0
Public Types | Public Member Functions | Private Attributes
pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType > Struct Template Reference

#include <pfunc/parallel_for.hpp>

Inheritance diagram for pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >:
pfunc::virtual_functor

List of all members.

Public Types

typedef PFuncInstanceType::taskmgr TaskMgrType
typedef PFuncInstanceType::task TaskType

Public Member Functions

 parallel_for (SpaceType space, const ForExecutable &func, TaskMgrType &taskmgr)
void operator() (void)

Private Attributes

SpaceType space
const ForExecutable & func
TaskMgrTypetaskmgr

Detailed Description

template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
struct pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >

A function much akin to for_each in STL. Takes in a range and a functor. The assumption is that the functor has the access to the entire container and hence all the harness needs to do is provide access to the correct range.

Parameters:
[in]spaceThe iteration space. space is a model of Space.
[in]funcThe function object to be applied to every element. This function object has to take in an object of space_1D. i.e., void operator (const space_1D& space) { ... } must be defined on func. func is a model of the ForExecutable concept.

NOTE: This function currently uses a local task manager.

NOTE: To use parallel_for, the Functor used in PFuncInstanceType must be pfunc::use_default! If a definite type is given, parallel_for fails to execute.


Member Typedef Documentation

template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
typedef PFuncInstanceType::taskmgr pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::TaskMgrType
template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
typedef PFuncInstanceType::task pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::TaskType

Constructor & Destructor Documentation

template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::parallel_for ( SpaceType  space,
const ForExecutable &  func,
TaskMgrType taskmgr 
) [inline]

Constructor

Parameters:
[in]spaceThe space over which to iterate
[in]funcThe function to execute over elements in this space
[in]taskmgrThe task manager to use for this parallel_for

TODO: Make parallel_for work with global task manager.


Member Function Documentation

template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
void pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::operator() ( void  ) [inline, virtual]

Member Data Documentation

template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
const ForExecutable& pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::func [private]
template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
SpaceType pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::space [private]
template<typename PFuncInstanceType, typename ForExecutable, typename SpaceType>
TaskMgrType& pfunc::parallel_for< PFuncInstanceType, ForExecutable, SpaceType >::taskmgr [private]

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