Documentation for Thread
Former-commit-id: b33bbdf473792ddcde8ffbe310722d83a1a12bcf
This commit is contained in:
@@ -6,18 +6,43 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \class Nz::TaskScheduler
|
||||
* \brief Core class that represents a thread pool
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Adds a task to the pending list
|
||||
*
|
||||
* \param function Task that the pool will execute
|
||||
*/
|
||||
|
||||
template<typename F>
|
||||
void TaskScheduler::AddTask(F function)
|
||||
{
|
||||
AddTaskFunctor(new FunctorWithoutArgs<F>(function));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds a task to the pending list
|
||||
*
|
||||
* \param function Task that the pool will execute
|
||||
* \param args Arguments of the function
|
||||
*/
|
||||
|
||||
template<typename F, typename... Args>
|
||||
void TaskScheduler::AddTask(F function, Args&&... args)
|
||||
{
|
||||
AddTaskFunctor(new FunctorWithArgs<F, Args...>(function, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Adds a task to the pending list
|
||||
*
|
||||
* \param function Task that the pool will execute
|
||||
* \param object Object on which the method will be called
|
||||
*/
|
||||
|
||||
template<typename C>
|
||||
void TaskScheduler::AddTask(void (C::*function)(), C* object)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user