AScheduler is an abstract class that implements the IScheduler interface. It provides common functionalities for schedulers, such as enabling/disabling systems and error handling. It also provides a default implementation for the RunSystem function, which executes a system according to the scheduler policy.
More...
#include <AScheduler.hpp>
AScheduler is an abstract class that implements the IScheduler interface. It provides common functionalities for schedulers, such as enabling/disabling systems and error handling. It also provides a default implementation for the RunSystem function, which executes a system according to the scheduler policy.
- See also
- Engine::Scheduler::IScheduler
◆ AScheduler()
| Engine::Scheduler::AScheduler::AScheduler |
( |
Core & | core | ) |
|
|
inlineexplicit |
◆ AddSystems()
template<typename... TSystems>
| decltype(auto) Engine::Scheduler::AScheduler::AddSystems |
( |
TSystems... | systems | ) |
|
|
inline |
Add systems to the scheduler.
- Template Parameters
-
| TSystems | Types of the systems to add. |
- Parameters
-
| systems | The systems to add. |
- Returns
- A tuple of FunctionIDs for the added systems. See FunctionUtils::FunctionContainer::AddFunctions for more details.
- Todo
- put the implementation in the inl file
◆ Disable()
Disable a system.
- Parameters
-
◆ Enable()
Enable a system.
- Parameters
-
◆ GetErrorPolicy()
◆ GetSystems()
| decltype(auto) Engine::Scheduler::AScheduler::GetSystems |
( |
| ) |
|
|
inline |
◆ Remove()
◆ RunSystem()
| void Engine::Scheduler::AScheduler::RunSystem |
( |
const SystemBase * | system, |
|
|
Core & | core ) |
Execute a system.
- Note
- The system will be executed according to the scheduler policy of the scheduler.
- Parameters
-
| system | The system to execute. |
| core | The core to pass to the system. |
- Todo
- Remove Core parameter from the function and use the reference to the core stored in the AScheduler class instead.
- See also
- Engine::SystemBase
◆ SetErrorPolicy()
◆ ShouldRunNextScheduler()
| bool Engine::Scheduler::AScheduler::ShouldRunNextScheduler |
( |
| ) |
const |
|
inline |
Get whether the next scheduler should run or not. This is mainly set by the error policy of the scheduler.
- Returns
- true if the next scheduler should run, false otherwise.
- Todo
check if we can remove this method and find a cleaner way to handle the error policy of the scheduler.
put the implementation in the cpp file, (remove inline)
◆ _core
| Core& Engine::Scheduler::AScheduler::_core |
|
protected |
Reference to the core.
- Note
- This reference is used to pass the core to the systems when executing them. It can also be used by the schedulers to access the core and its resources.
- See also
- Engine::Core
◆ _disabledSystemsList
List of disabled systems in the scheduler.
◆ _enabledSystemsList
List of enabled systems in the scheduler.
◆ _errorPolicy
The error policy of the scheduler. It defines how the scheduler should handle errors that occur during the execution of its systems.
◆ _shouldRunNextScheduler
| bool Engine::Scheduler::AScheduler::_shouldRunNextScheduler = true |
|
private |
A state if the next scheduler should be executed or not. This is mainly used to handle the error policy of the scheduler.
◆ _shouldRunSystems
| bool Engine::Scheduler::AScheduler::_shouldRunSystems = true |
|
private |
A state if the systems of the scheduler should be executed or not. If false, the scheduler will skip the execution of its systems. This is mainly used to handle the error policy of the scheduler.
The documentation for this class was generated from the following files: