Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | Public Attributes | List of all members
castor::WorkerThread Class Reference

#include <WorkerThread.hpp>

Inheritance diagram for castor::WorkerThread:
Inheritance graph
[legend]
Collaboration diagram for castor::WorkerThread:
Collaboration graph
[legend]

Public Types

using Job = castor::Function< void() >
 
using OnEnded = SignalT< castor::Function< void( WorkerThread const & ) > >
 

Public Member Functions

CU_API WorkerThread ()
 Constructor.
 
CU_API ~WorkerThread () noexcept
 Destructor.
 
CU_API void feed (Job job)
 Runs the given job.
 
CU_API bool isEnded () const
 
CU_API bool wait (Milliseconds const &timeout) const
 Waits for the job end for a given time.
 

Public Attributes

OnEnded onEnded
 

Additional Inherited Members

- Protected Member Functions inherited from castor::NonMovable
 NonMovable ()=default
 Constructor.
 
 ~NonMovable () noexcept=default
 Destructor.
 

Member Typedef Documentation

◆ Job

◆ OnEnded

Constructor & Destructor Documentation

◆ WorkerThread()

CU_API castor::WorkerThread::WorkerThread ( )

Constructor.

◆ ~WorkerThread()

CU_API castor::WorkerThread::~WorkerThread ( )
noexcept

Destructor.

Member Function Documentation

◆ feed()

CU_API void castor::WorkerThread::feed ( Job job)

Runs the given job.

Parameters
[in]jobThe job.

◆ isEnded()

CU_API bool castor::WorkerThread::isEnded ( ) const
Returns
true if the job is ended.

◆ wait()

CU_API bool castor::WorkerThread::wait ( Milliseconds const & timeout) const

Waits for the job end for a given time.

Parameters
[in]timeoutThe maximum time to wait.
Returns
true if the task is ended.

Member Data Documentation

◆ onEnded

OnEnded castor::WorkerThread::onEnded
Returns
The signal raised when the worker has ended his job.

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