Core: Rework TaskScheduler (WIP)

This commit is contained in:
Lynix
2024-01-31 16:42:25 +01:00
parent 2b88f50c21
commit 9d669f722e
9 changed files with 239 additions and 797 deletions

View File

@@ -6,49 +6,6 @@
namespace Nz
{
/*!
* \ingroup core
* \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)
{
AddTaskFunctor(new MemberWithoutArgs<C>(function, object));
}
}
#include <Nazara/Core/DebugOff.hpp>