Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::Task< void > Class Reference

Task specialization for void. More...

#include <coroutine_utils.h>

Classes

struct  promise_type
 Promise type for Task. More...
 

Public Types

using handle_type = std::coroutine_handle<promise_type>
 Handle type for Task.
 
using handle_type
 Handle type for Task.
 

Public Member Functions

 Task (handle_type h)
 Constructor with handle.
 
 Task (Task &&other) noexcept
 Constructor with other Task.
 
Taskoperator= (Task &&other) noexcept
 Operator= for Task.
 
 Task (const Task &)=delete
 
Taskoperator= (const Task &)=delete
 
bool await_ready () const noexcept
 Await ready for Task.
 
void await_suspend (std::coroutine_handle<> awaiting)
 Await suspend for Task.
 
void await_resume ()
 Await resume for Task.
 
void get_sync ()
 Get the result of the Task synchronously.
 
 Task () noexcept
 Constructor with no handle.
 
 Task (handle_type h)
 Constructor with handle.
 
 Task (Task &&other) noexcept
 Constructor with other Task.
 
 Task (const Task &)=delete
 
Taskoperator= (Task &&other) noexcept
 Operator= for Task.
 
Taskoperator= (const Task &)=delete
 
bool valid () const noexcept
 Valid for Task.
 
bool await_ready () const noexcept
 Await ready for Task.
 
void await_suspend (std::coroutine_handle<> awaiting)
 Await suspend for Task.
 
void await_resume ()
 Await resume for Task.
 
void get_sync ()
 Synchronously wait and get the value (used by blockingWait)
 

Detailed Description

Task specialization for void.

Constructor & Destructor Documentation

◆ Task() [1/4]

agents::Task< void >::Task ( handle_type h)
inlineexplicit

Constructor with handle.

Parameters
hThe handle to use

◆ Task() [2/4]

agents::Task< void >::Task ( Task< void > && other)
inlinenoexcept

Constructor with other Task.

Parameters
otherThe other Task to use

◆ Task() [3/4]

agents::Task< void >::Task ( handle_type h)
inlineexplicit

Constructor with handle.

Parameters
hThe handle to use

◆ Task() [4/4]

agents::Task< void >::Task ( Task< void > && other)
inlinenoexcept

Constructor with other Task.

Parameters
otherThe other Task to use

Member Function Documentation

◆ await_ready() [1/2]

bool agents::Task< void >::await_ready ( ) const
inlinenoexcept

Await ready for Task.

Returns
Whether the Task is ready

◆ await_ready() [2/2]

bool agents::Task< void >::await_ready ( ) const
inlinenoexcept

Await ready for Task.

Returns
Whether the Task is ready

◆ await_resume()

void agents::Task< void >::await_resume ( )
inline

Await resume for Task.

Returns
The awaited result if T is not void.

◆ await_suspend() [1/2]

void agents::Task< void >::await_suspend ( std::coroutine_handle<> awaiting)
inline

Await suspend for Task.

Parameters
awaitingThe awaiting coroutine handle

◆ await_suspend() [2/2]

void agents::Task< void >::await_suspend ( std::coroutine_handle<> awaiting)
inline

Await suspend for Task.

Parameters
awaitingThe awaiting coroutine handle

◆ get_sync()

void agents::Task< void >::get_sync ( )
inline

Synchronously wait and get the value (used by blockingWait)

Returns
The result of the Task

◆ operator=() [1/2]

Task & agents::Task< void >::operator= ( Task< void > && other)
inlinenoexcept

Operator= for Task.

Parameters
otherThe other Task to use
Returns
The Task

◆ operator=() [2/2]

Task & agents::Task< void >::operator= ( Task< void > && other)
inlinenoexcept

Operator= for Task.

Parameters
otherThe other Task to use
Returns
The Task

◆ valid()

bool agents::Task< void >::valid ( ) const
inlinenoexcept

Valid for Task.

Returns
Whether the Task is valid