#pragma once #include #include /** * \brief This class is a Thread Object which allows to create Functors and attach them to this thread object. * * @author Torben Dannhauer * @date Okt 2012 */ class ChannelWorker : public osg::Referenced, public OpenThreads::Thread { public: ChannelWorker() ; ~ChannelWorker(); //Destroying the thread object will implicit call cancel(), then the function will block until the thread has finished. virtual void run(); virtual int cancel(); void setDone(bool done); // sinbgals the thread to stop but returns immediately. Use cancel if you want to wait blocking until the thread is canceled. bool getDone() const { return _done; } private: bool _done; };