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

Thread event interface. More...

#include <ThreadEvent.h>

Inheritance diagram for sptk::ThreadEvent:
sptk::ThreadPool sptk::TCPServer sptk::WSListener

Public Types

enum class  Type : uint8_t {
  THREAD_STARTED , THREAD_FINISHED , RUNABLE_STARTED , RUNABLE_FINISHED ,
  IDLE_TIMEOUT
}
 Thread event type. More...
 

Public Member Functions

virtual void threadEvent (Thread *thread, Type eventType, SRunable runable)=0
 Thread event callback function. More...
 
virtual ~ThreadEvent ()=default
 Destructor.
 

Detailed Description

Thread event interface.

Member Enumeration Documentation

◆ Type

enum class sptk::ThreadEvent::Type : uint8_t
strong

Thread event type.

Enumerator
THREAD_STARTED 

Thread started event.

THREAD_FINISHED 

Thread finished event.

RUNABLE_STARTED 

Runable started.

RUNABLE_FINISHED 

Runable finished.

IDLE_TIMEOUT 

Thread was idle longer than defined idle timeout.

Member Function Documentation

◆ threadEvent()

virtual void sptk::ThreadEvent::threadEvent ( Thread thread,
Type  eventType,
SRunable  runable 
)
pure virtual

Thread event callback function.

In order to receive thread events, event receiver should be derived from this class.

Parameters
threadThread where event occured
eventTypeThread event type
runableRelated runable (if any)

Implemented in sptk::TCPServer, and sptk::ThreadPool.


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

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