cppassist  1.0.0.f4fab4f962ff
C++ sanctuary for small but powerful and frequently required, stand alone features.
Classes | Namespaces | Functions
parallelfor.h File Reference
#include <functional>
#include <vector>
#include <cppassist/cppassist_api.h>
#include <cppassist/threading/parallelfor.inl>
Include dependency graph for parallelfor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cppassist::identity< T >
 Helper class to deduce function types with lambdas. More...
 

Namespaces

 cppassist
 

Functions

CPPASSIST_API size_t cppassist::getNumberOfThreads ()
 Get optimal number of threads for parallelization. More...
 
template<typename T >
void cppassist::forEach (T start, T end, typename identity< std::function< void(T)>>::type callback, bool parallelize=true)
 Call a function on each iteration of a loop. More...
 
template<typename T >
void cppassist::parallelFor (T start, T end, typename identity< std::function< void(T)>>::type callback)
 Call a function on each iteration of a loop (parallelized in threads) More...
 
template<typename T >
void cppassist::parallelFor (const std::vector< T > &elements, typename identity< std::function< void(const T &element)>>::type callback)
 Call a function on each item of a list (parallelized in threads) More...
 
template<typename T >
void cppassist::parallelFor (std::vector< T > &elements, typename identity< std::function< void(T &element)>>::type callback)
 Call a function on each item of a list (parallelized in threads) More...
 
template<typename T >
void cppassist::sequentialFor (T start, T end, typename identity< std::function< void(T)>>::type callback)
 Call a function on each iteration of a loop (sequential) More...
 
template<typename T >
void cppassist::sequentialFor (const std::vector< T > &elements, typename identity< std::function< void(const T &element)>>::type callback)
 Call a function on each item of a list (sequential) More...
 
template<typename T >
void cppassist::sequentialFor (std::vector< T > &elements, typename identity< std::function< void(T &element)>>::type callback)
 Call a function on each item of a list (sequential) More...