CMS 3D CMS Logo

FunctorTask.h
Go to the documentation of this file.
1 #ifndef FWCore_Concurrency_FunctorTask_h
2 #define FWCore_Concurrency_FunctorTask_h
3 // -*- C++ -*-
4 //
5 // Package: Concurrency
6 // Class : FunctorTask
7 //
15 //
16 // Original Author: Chris Jones
17 // Created: Thu Feb 21 13:46:31 CST 2013
18 // $Id$
19 //
20 
21 // system include files
22 #include <atomic>
23 #include <exception>
24 #include <memory>
25 #include "tbb/task.h"
26 
27 // user include files
28 
29 // forward declarations
30 
31 namespace edm {
32  template <typename F>
33  class FunctorTask : public tbb::task {
34  public:
35  explicit FunctorTask(F f) : func_(std::move(f)) {}
36 
37  task* execute() override {
38  func_();
39  return nullptr;
40  };
41 
42  private:
43  F func_;
44  };
45 
46  template <typename ALLOC, typename F>
47  FunctorTask<F>* make_functor_task(ALLOC&& iAlloc, F f) {
48  return new (iAlloc) FunctorTask<F>(std::move(f));
49  }
50 } // namespace edm
51 
52 #endif
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
Definition: FunctorTask.h:47
task * execute() override
Definition: FunctorTask.h:37
double f[11][100]
HLT enums.
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
def move(src, dest)
Definition: eostools.py:511