RAUL
0.5.1
|
Abstract base class for a thread. More...
#include <Thread.hpp>
Static Public Member Functions | |
static Thread * | create (const std::string &name="") |
static Thread * | create_for_this_thread (const std::string &name="") |
Must be called from thread. | |
static Thread & | get () |
Protected Member Functions | |
Thread (const std::string &name="") | |
Thread (pthread_t thread, const std::string &name="") | |
virtual void | _run () |
Thread function to execute. More... | |
Protected Attributes | |
bool | _exit_flag |
Abstract base class for a thread.
Extend this and override the _run method to easily create a thread to perform some task.
The current Thread can be accessed using the get() method.
|
inlineprotectedvirtual |
Thread function to execute.
This is called once on start, and terminated on stop. Implementations likely want to put some infinite loop here.
When _exit_flag becomes true (via a call to stop()) the loop should exit.