IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::TaskHandle Struct Referencefinal

Special handle accessing task information at runtime. More...

#include <ice/task_handle.hxx>

Public Member Functions

 TaskHandle () noexcept
 TaskHandle (TaskHandle &&other) noexcept
 TaskHandle (TaskHandle const &other) noexcept
 ~TaskHandle () noexcept
auto operator= (TaskHandle &&other) noexcept -> TaskHandle &
auto operator= (TaskHandle const &other) noexcept -> TaskHandle &
auto state () const noexcept
bool is_valid () const noexcept
bool is_running () const noexcept
bool is_suspended () const noexcept
bool was_cancelled () const noexcept
bool has_finished () const noexcept
bool has_succeded () const noexcept
bool has_failed () const noexcept
bool cancel () noexcept
 Sends a cancel request to the connected task.

Public Attributes

ice::TaskInfo_info

Detailed Description

Special handle accessing task information at runtime.

Note
Accessing handles can only be done on task creation, for coroutines that define ice::TaskToken as one of their arguments. In allo ther cases the task will not bookkeep any information related it's lifetime.

Constructor & Destructor Documentation

◆ TaskHandle() [1/3]

ice::TaskHandle::TaskHandle ( )
inlinenoexcept

◆ TaskHandle() [2/3]

ice::TaskHandle::TaskHandle ( TaskHandle && other)
inlinenoexcept

◆ TaskHandle() [3/3]

ice::TaskHandle::TaskHandle ( TaskHandle const & other)
inlinenoexcept

◆ ~TaskHandle()

ice::TaskHandle::~TaskHandle ( )
inlinenoexcept

Member Function Documentation

◆ cancel()

bool ice::TaskHandle::cancel ( )
inlinenoexcept

Sends a cancel request to the connected task.

Returns
'true' if the handle was valid and the task was in the 'Running' state.

◆ has_failed()

bool ice::TaskHandle::has_failed ( ) const
inlinenoexcept
Returns
'true' if the state value contains the 'Failed' flag.
Precondition
The handle needs to be assigned to a valid task.

◆ has_finished()

bool ice::TaskHandle::has_finished ( ) const
inlinenoexcept
Returns
'true' if the state value contains either 'Succeeded' or 'Failed' flags.
Precondition
The handle needs to be assigned to a valid task.

◆ has_succeded()

bool ice::TaskHandle::has_succeded ( ) const
inlinenoexcept
Returns
'true' if the state value contains the 'Succeeded' flag.
Precondition
The handle needs to be assigned to a valid task.

◆ is_running()

bool ice::TaskHandle::is_running ( ) const
inlinenoexcept
Returns
'true' if the state value contains the 'Running' flag.
Precondition
The handle needs to be assigned to a valid task.

◆ is_suspended()

bool ice::TaskHandle::is_suspended ( ) const
inlinenoexcept
Returns
'true' if the state value contains the 'Suspended' flag.
Note
This flag is currently not set.
Precondition
The handle needs to be assigned to a valid task.

◆ is_valid()

bool ice::TaskHandle::is_valid ( ) const
inlinenoexcept
Returns
'true' if the handle was assigned to a task object.
Precondition
The handle needs to be assigned to a valid task.

◆ operator=() [1/2]

auto ice::TaskHandle::operator= ( TaskHandle && other) -> TaskHandle &
inlinenoexcept

◆ operator=() [2/2]

auto ice::TaskHandle::operator= ( TaskHandle const & other) -> TaskHandle &
inlinenoexcept

◆ state()

auto ice::TaskHandle::state ( ) const
inlinenoexcept
Returns
The current state of the assigned task or 'TaskState::Invalid' if not task was assigned to this handle.

◆ was_cancelled()

bool ice::TaskHandle::was_cancelled ( ) const
inlinenoexcept
Returns
'true' if the state value contains the 'Canceled' flag.
Precondition
The handle needs to be assigned to a valid task.

Member Data Documentation

◆ _info

ice::TaskInfo* ice::TaskHandle::_info

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