#include <Runable.h>
Public Member Functions | |
Runable (const String &name) | |
virtual | ~Runable ()=default |
void | execute () |
virtual void | terminate () |
bool | terminated () const |
String | name () const |
Protected Member Functions | |
virtual void | run ()=0 |
Abstract runable object.
Should be used for deriving a user class for executing by a worker thread in a thread pool. Derived class must override run() method.
|
explicit |
Default Constructor
|
virtualdefault |
Destructor
void sptk::Runable::execute | ( | ) |
Executes task' run method
Task may be executed multiple times, but only one caller may execute same task at a time.
|
inline |
|
protectedpure virtual |
Method that is executed by worker thread
Should be overwritten by derived class.
Implemented in sptk::ServerConnection, and sptk::WSConnection.
|
virtual |
Requests execution termination
Reimplemented in sptk::TCPServerConnection.
Referenced by sptk::TCPServerConnection::terminate().
bool sptk::Runable::terminated | ( | ) | const |
Returns true if terminate request is sent to runable