Beatmup
Beatmup::ThreadPool::EventListener Class Reference

Event listener class. More...

#include <thread_pool.hpp>

Inheritance diagram for Beatmup::ThreadPool::EventListener:
Beatmup::Context::Impl::ThreadPoolEventListener

Public Member Functions

virtual void threadCreated (PoolIndex pool)
 Callback function called when a new worker thread is created. More...
 
virtual void threadTerminating (PoolIndex pool)
 Callback function called when a worker thread is terminating. More...
 
virtual bool taskDone (PoolIndex pool, AbstractTask &task, bool aborted)
 Callback function called when a task is done or cancelled; if returns true, the task will be repeated. More...
 
virtual void taskFail (PoolIndex pool, AbstractTask &task, const std::exception_ptr exPtr)
 Callback function called when an exception is thrown. More...
 
virtual void gpuInitFail (PoolIndex pool, const std::exception_ptr exPtr)
 Callback function called when the GPU cannot start. More...
 

Detailed Description

Event listener class.

Definition at line 86 of file thread_pool.hpp.

Member Function Documentation

◆ threadCreated()

virtual void Beatmup::ThreadPool::EventListener::threadCreated ( PoolIndex  pool)
inlinevirtual

Callback function called when a new worker thread is created.

Parameters
poolThread pool number in the context

Reimplemented in Beatmup::Context::Impl::ThreadPoolEventListener.

Definition at line 92 of file thread_pool.hpp.

92 {};

◆ threadTerminating()

virtual void Beatmup::ThreadPool::EventListener::threadTerminating ( PoolIndex  pool)
inlinevirtual

Callback function called when a worker thread is terminating.

Parameters
poolThread pool number in the context

Reimplemented in Beatmup::Context::Impl::ThreadPoolEventListener.

Definition at line 98 of file thread_pool.hpp.

98 {};

◆ taskDone()

virtual bool Beatmup::ThreadPool::EventListener::taskDone ( PoolIndex  pool,
AbstractTask task,
bool  aborted 
)
inlinevirtual

Callback function called when a task is done or cancelled; if returns true, the task will be repeated.

Parameters
poolThread pool number in the context
taskThe task
abortedIf true, the task was aborted

Reimplemented in Beatmup::Context::Impl::ThreadPoolEventListener.

Definition at line 106 of file thread_pool.hpp.

106  {
107  return false;
108  }

◆ taskFail()

virtual void Beatmup::ThreadPool::EventListener::taskFail ( PoolIndex  pool,
AbstractTask task,
const std::exception_ptr  exPtr 
)
inlinevirtual

Callback function called when an exception is thrown.

Parameters
poolThread pool number in the context
taskThe task that was running when the exception was thrown
exPtrException pointer

Reimplemented in Beatmup::Context::Impl::ThreadPoolEventListener.

Definition at line 116 of file thread_pool.hpp.

116 {};

◆ gpuInitFail()

virtual void Beatmup::ThreadPool::EventListener::gpuInitFail ( PoolIndex  pool,
const std::exception_ptr  exPtr 
)
inlinevirtual

Callback function called when the GPU cannot start.

Parameters
poolThread pool number in the context
exPtrException pointer; points to the exception instance occurred when starting up the GPU

Reimplemented in Beatmup::Context::Impl::ThreadPoolEventListener.

Definition at line 123 of file thread_pool.hpp.

123 {};

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