CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RunLoop Class Referenceabstract

An ASIO execution context that wraps the operating system run loop. More...

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

Inheritance diagram for CeresEngine::RunLoop:
CeresEngine::ExecutionContext CeresEngine::AppleRunLoop CeresEngine::EmscriptenRunLoop CeresEngine::Win32RunLoop

Public Member Functions

 ~RunLoop () noexcept override=default
 Destroys the RunLoop.
 
virtual void run ()=0
 Starts running the run loop.
 
virtual void stop ()=0
 Stops the execution of the run loop.
 
- Public Member Functions inherited from CeresEngine::ExecutionContext
virtual ~ExecutionContext () noexcept=default
 Virtual destructor for the execution context object.
 
template<typename T >
bool hasService () noexcept
 Determine if the ExecutionContext contains the specified service type.
 
template<typename T >
T & getService () noexcept
 Obtain the service object corresponding to the given type.
 
template<typename T >
T * getServiceIf () noexcept
 Obtain the service object corresponding to the given type.
 
virtual AnyExecutor getExecutor () noexcept=0
 Returns an executor that run execute scheduled commands on the context.
 
executor_type get_executor () noexcept
 Returns an executor that run execute scheduled commands on the context.
 
bool isActive () const noexcept
 Checks if the execution context is currently active.
 

Additional Inherited Members

- Public Types inherited from CeresEngine::ExecutionContext
using ID = id
 
using executor_type = AnyExecutor
 
- Static Public Member Functions inherited from CeresEngine::ExecutionContext
static ExecutionContext * getCurrent () noexcept
 Gets the current execution context, if any is active.
 
static ExecutionContext & get () noexcept
 Gets the current execution context, if any is active.
 

Detailed Description

An ASIO execution context that wraps the operating system run loop.

Constructor & Destructor Documentation

◆ ~RunLoop()

CeresEngine::RunLoop::~RunLoop ( )
overridedefaultnoexcept

Destroys the RunLoop.

Member Function Documentation

◆ run()

virtual void CeresEngine::RunLoop::run ( )
pure virtual

Starts running the run loop.

Note
This can only be called from the thread that corresponds to the run loop execution.

Implemented in CeresEngine::AppleRunLoop, CeresEngine::EmscriptenRunLoop, and CeresEngine::Win32RunLoop.

◆ stop()

virtual void CeresEngine::RunLoop::stop ( )
pure virtual

Stops the execution of the run loop.

Note
This can be called from any thread.

Implemented in CeresEngine::AppleRunLoop, CeresEngine::EmscriptenRunLoop, and CeresEngine::Win32RunLoop.


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