5 #ifndef G4ATLASTOOLS_THREADSPECIFICUSERACTION_H
6 #define G4ATLASTOOLS_THREADSPECIFICUSERACTION_H
14 #include "tbb/concurrent_unordered_map.h"
29 template<
class ActionType>
47 delete mapPair.second;
54 auto mapItr =
m_threadMap.find( std::this_thread::get_id() );
56 return mapItr->second;
62 const auto tid = std::this_thread::get_id();
87 template<
class ResultType,
class Mapper,
class Reducer >
92 std::function<
const ResultType&(
const ActionType&)> mapper = mapOp;
93 std::function<void(ResultType&,
const ResultType&)> reducer = reduceOp;
96 reducer(
result, mapper(*keyVal.second) );
109 #endif // G4ATLASTOOLS_THREADSPECIFICUSERACTION_H