CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::IdleService Class Referencefinal

A service that allows submitting work to be ran whenever the executor is going idle. More...

#include <CeresEngine/Foundation/IO/IdleService.hpp>

Inheritance diagram for CeresEngine::IdleService:
CeresEngine::ExecutionContext::Service< IdleService >

Public Member Functions

template<typename Function >
void post (Function &&function)
 Submits a new callback to be invoked.
 
void poll ()
 Polls the service for any work.
 
- Public Member Functions inherited from CeresEngine::ExecutionContext::Service< IdleService >
ExecutionContextgetExecutionContext () noexcept
 Returns the execution context to which the service is attached to.
 
AnyExecutor getExecutor () noexcept
 Returns an executor that run execute scheduled commands on the context.
 

Private Member Functions

void shutdown () final
 

Private Attributes

List< UniqueFunction< void()> > mQueue
 A list of work to be ran by the service the next time it's executor becomes idle.
 

Additional Inherited Members

- Static Public Attributes inherited from CeresEngine::ExecutionContext::Service< IdleService >
static const ID id
 

Detailed Description

A service that allows submitting work to be ran whenever the executor is going idle.

Member Function Documentation

◆ poll()

void CeresEngine::IdleService::poll ( )

Polls the service for any work.

Usually called from an executor the moment it goes idle.

◆ post()

template<typename Function >
void CeresEngine::IdleService::post ( Function &&  function)
inline

Submits a new callback to be invoked.

Parameters
functionThe function callback to be run the next time the executor goes idle.

◆ shutdown()

void CeresEngine::IdleService::shutdown ( )
finalprivate

Member Data Documentation

◆ mQueue

List<UniqueFunction<void()> > CeresEngine::IdleService::mQueue
private

A list of work to be ran by the service the next time it's executor becomes idle.


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