|
| TaskScheduler () |
|
template<typename P > |
| TaskScheduler (P &&predicate) |
|
| TaskScheduler (TaskScheduler const &)=delete |
|
| TaskScheduler (TaskScheduler &&)=delete |
|
TaskScheduler & | operator= (TaskScheduler const &)=delete |
|
TaskScheduler & | operator= (TaskScheduler &&)=delete |
|
template<typename P > |
TaskScheduler & | SetValidator (P &&predicate) |
| Sets a validator which is asked if tasks are allowed to be executed. More...
|
|
TaskScheduler & | ClearValidator () |
| Clears the validator which is asked if tasks are allowed to be executed. More...
|
|
TaskScheduler & | Update (success_t const &callback=EmptyCallback) |
|
TaskScheduler & | Update (size_t const milliseconds, success_t const &callback=EmptyCallback) |
|
template<class _Rep , class _Period > |
TaskScheduler & | Update (std::chrono::duration< _Rep, _Period > const &difftime, success_t const &callback=EmptyCallback) |
|
TaskScheduler & | Async (std::function< void()> const &callable) |
|
template<class _Rep , class _Period > |
TaskScheduler & | Schedule (std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task) |
|
template<class _Rep , class _Period > |
TaskScheduler & | Schedule (std::chrono::duration< _Rep, _Period > const &time, group_t const group, task_handler_t const &task) |
|
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > |
TaskScheduler & | Schedule (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max, task_handler_t const &task) |
|
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > |
TaskScheduler & | Schedule (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max, group_t const group, task_handler_t const &task) |
|
TaskScheduler & | CancelAll () |
|
TaskScheduler & | CancelGroup (group_t const group) |
|
TaskScheduler & | CancelGroupsOf (std::vector< group_t > const &groups) |
|
template<class _Rep , class _Period > |
TaskScheduler & | DelayAll (std::chrono::duration< _Rep, _Period > const &duration) |
| Delays all tasks with the given duration. More...
|
|
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > |
TaskScheduler & | DelayAll (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Delays all tasks with a random duration between min and max. More...
|
|
template<class _Rep , class _Period > |
TaskScheduler & | DelayGroup (group_t const group, std::chrono::duration< _Rep, _Period > const &duration) |
| Delays all tasks of a group with the given duration. More...
|
|
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > |
TaskScheduler & | DelayGroup (group_t const group, std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Delays all tasks of a group with a random duration between min and max. More...
|
|
template<class _Rep , class _Period > |
TaskScheduler & | RescheduleAll (std::chrono::duration< _Rep, _Period > const &duration) |
| Reschedule all tasks with a given duration. More...
|
|
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > |
TaskScheduler & | RescheduleAll (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Reschedule all tasks with a random duration between min and max. More...
|
|
template<class _Rep , class _Period > |
TaskScheduler & | RescheduleGroup (group_t const group, std::chrono::duration< _Rep, _Period > const &duration) |
| Reschedule all tasks of a group with the given duration. More...
|
|
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > |
TaskScheduler & | RescheduleGroup (group_t const group, std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
| Reschedule all tasks of a group with a random duration between min and max. More...
|
|
The TaskScheduler class provides the ability to schedule std::function's in the near future. Use TaskScheduler::Update to update the scheduler. Popular methods are:
- Schedule (Schedules a std::function which will be executed in the near future).
- Schedules an asynchronous function which will be executed at the next update tick.
- Cancel, Delay & Reschedule (Methods to manipulate already scheduled tasks). Tasks are organized in groups (uint), multiple tasks can have the same group id, you can provide a group or not, but keep in mind that you can only manipulate specific tasks through its group id! Tasks callbacks use the function signature void(TaskContext) where TaskContext provides access to the function schedule plan which makes it possible to repeat the task with the same duration or a new one. It also provides access to the repeat counter which is useful for task that repeat itself often but behave different every time (spoken event dialogs for example).