source: experimental/Threading/Threading/ThreadWorkerBase.h @ 425

Last change on this file since 425 was 425, checked in by Torben Dannhauer, 12 years ago
File size: 831 bytes
Line 
1#pragma once
2#include <osg/Referenced>
3
4
5class 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 */ 
18class ThreadWorkerBase : public osg::Referenced
19{
20public:
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.