SPAOP
|
A wrapper for the std::thread wrapping it into a Java-style thread object. More...
#include <Thread.h>
Public Member Functions | |
Thread () | |
Constructor. More... | |
virtual | ~Thread () |
Destructor. More... | |
void | start () |
Starts the Thread. More... | |
void | stop () |
Sets the internal flag stopped_ to true. More... | |
void | join () |
Joins the thread. More... | |
Protected Member Functions | |
virtual void | run ()=0 |
This is the method that will be executed by the thread. More... | |
bool | isStopped () const |
Returns true if the thread was stopped. More... | |
A wrapper for the std::thread wrapping it into a Java-style thread object.
Derived classes override the abstract run() method which will be exectued by the thread represented by this class.
thread::Thread::Thread | ( | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
Returns true if the thread was stopped.
Must be checked regularly from within run().
void thread::Thread::join | ( | ) |
Joins the thread.
|
protectedpure virtual |
This is the method that will be executed by the thread.
In case this is implemented with a loop, isStopped() should be checked reguarly (and the loop shall be exited if isStopped() returns true).
Implemented in wonderlo::WonderOscSenderThread.
void thread::Thread::start | ( | ) |
void thread::Thread::stop | ( | ) |
Sets the internal flag stopped_ to true.