VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTbbTaskLamda.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <tbb/task.h>
13 
14 namespace makVrv
15 {
19  template<typename F>
20  class DtTbbLamdaTask : public tbb::task {
21  F myFunc;
22  tbb::task* execute() override
23  {
24  myFunc();
25  return nullptr;
26  }
27  public:
28  DtTbbLamdaTask(const F& f)
29  : myFunc(f)
30  {
31  }
32  };
33 
34  template<typename F>
35  void DtTbbEnqueueLamda(const F& f) {
36  tbb::task::enqueue(*new(tbb::task::allocate_root()) DtTbbLamdaTask<F>(f));
37  }
38 }
void DtTbbEnqueueLamda(const F &f)
Definition: DtTbbTaskLamda.h:35
DtTbbLamdaTask(const F &f)
Definition: DtTbbTaskLamda.h:28
tbb::task * execute() override
Definition: DtTbbTaskLamda.h:22
This provides a way to enqueue a tbb task with a tbb lambda This greatly improves readability https:/...
Definition: DtTbbTaskLamda.h:20
F myFunc
Definition: DtTbbTaskLamda.h:21

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)