Line | |
---|
1 | #pragma once |
---|
2 | #include <osg/Referenced> |
---|
3 | |
---|
4 | |
---|
5 | class ThreadedWorker; |
---|
6 | |
---|
7 | /** |
---|
8 | * \brief This class is an abstract "Thread Worker" which allows to implement tasks to be executed in a seperate thread. |
---|
9 | * |
---|
10 | * Just overload the operator() with your code you want to execute threaded in a loop. |
---|
11 | * Each execution will be completed by the thread, if the thread is set as done/canceled during a run, the cancelation will be postponed until the execution of the functor is completed. |
---|
12 | * |
---|
13 | * Note: This functor will be executed in a loop until the thread is canceled or set as done=true. |
---|
14 | * |
---|
15 | * @author Torben Dannhauer |
---|
16 | * @date Okt 2012 |
---|
17 | */ |
---|
18 | class ThreadWorkerBase : public osg::Referenced |
---|
19 | { |
---|
20 | public: |
---|
21 | ThreadWorkerBase(); |
---|
22 | virtual ~ThreadWorkerBase() ; |
---|
23 | |
---|
24 | virtual void operator() (ThreadedWorker* threadObject) = 0; |
---|
25 | |
---|
26 | |
---|
27 | |
---|
28 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.