sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::Runable Class Referenceabstract

#include <Runable.h>

Inheritance diagram for sptk::Runable:
sptk::ServerConnection sptk::SSLServerConnection sptk::TCPServerConnection sptk::WSConnection sptk::WSSSLConnection

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Runable()

sptk::Runable::Runable ( const String name)
explicit

Default Constructor

◆ ~Runable()

virtual sptk::Runable::~Runable ( )
virtualdefault

Destructor

Member Function Documentation

◆ execute()

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.

◆ name()

String sptk::Runable::name ( ) const
inline
Returns
object name

◆ run()

virtual void sptk::Runable::run ( )
protectedpure virtual

Method that is executed by worker thread

Should be overwritten by derived class.

Implemented in sptk::ServerConnection, and sptk::WSConnection.

◆ terminate()

virtual void sptk::Runable::terminate ( )
virtual

Requests execution termination

Reimplemented in sptk::TCPServerConnection.

Referenced by sptk::TCPServerConnection::terminate().

◆ terminated()

bool sptk::Runable::terminated ( ) const

Returns true if terminate request is sent to runable


The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:44: SPTK 5.4.1