#pragma once #include class ThreadedWorker; /** * \brief This class is an abstract "Thread Worker" which allows to implement tasks to be executed in a seperate thread. * * Just overload the operator() with your code you want to execute threaded in a loop. * 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. * * Note: This functor will be executed in a loop until the thread is canceled or set as done=true. * * @author Torben Dannhauer * @date Okt 2012 */ class ThreadWorkerBase : public osg::Referenced { public: ThreadWorkerBase(); virtual ~ThreadWorkerBase() ; virtual void operator() (ThreadedWorker* threadObject) = 0; };